scroll around a image in groovy? - swing

IM trying to scroll around a image in groovy but not work
IM using this code and appears a image static
How I could scroll with this code
panel(layout: new BorderLayout()) {
scrollPane(size:[100,100],
verticalScrollBarPolicy:JScrollPane.VERTICAL_SCROLLBAR_ALWAYS) {
panel(size:[200,100]) {
label(icon: imageIcon(new URL("file:pokemon.png")))
}
}
}
Please help me.

Finally I solve with this
scrollPane(id:'scroll',preferredSize: [200,200], constraints: context.CENTER) {
panel(layout: new FlowLayout()) {
label(icon: imageIcon(new URL('file:///path/pokemon.png')))
}
}

Related

Insatgram ?__a=1 Php user data get doesn't work anymore

In the past when I used to send requests to get user's data in JSON format I just did:
https://www.instagram.com/user_name/?__a=1
and it would return me all the data and the first 12 posts(with their picture's link)
but now it is just returning:
for (;;);
{
"__ar":1,
"error":1357004,
"errorSummary":"Sorry, something went wrong",
"errorDescription":"Please try closing and re-opening your browser window.",
"payload":null,
"hsrp":
{
"hblp":
{
"consistency":
{
"rev":1005869239
}
}
},
"lid":"7122014805466860625"
}
for some weird reason, and my app is not working anymore because of that, does someone have an idea how to fix that?

Make a play pause switch with html audio

I'm looking for a way to do a play / pause action on click of an element.
Basically when you click and the track is not playing it plays and when it's playing and you click it stops.
So far I was looking for a solution like this but it seems to make a conflict between the play / pause action.
$('#feli').click(function() {
feli.currentTime = 0;
if (feli.play()) {
feli.pause();
} else {
feli.play();;
}
})
Any tips on how to do this simple action ?
Thanks !!
check this code plz
$('#feli').click(function() {
if (feli.play()) {
feli.pause();
feli.currentTime = 0;
} else {
feli.play();;
}
});
Found my solution I put it here :
$('#feli').click(function() {
if (feli.paused) {
feli.currentTime = 0;
feli.play();
} else {
feli.pause();
}
})

Header property in custom theme is not working

I'm creating a sample theme for Power BI and trying to set the font color for header and it is not updating automatically after importing.
Is there any issue in my below sample. Can anyone please help?
Here is my sample JSON:
{
"visualStyles":{
"donutChart":{
"*":{
"legend":[
{
"show":true,
"fontSize":"16",
"labelcolor":"#8aa5d1"
}
],
"header":[
{
"show":true,
"fontcolor":"#8aa5d1"
}
],
"labels":[
{
"backColor":"#456B99",
"fontColor":"#8aa5d1",
"fontSize":"12",
"labelStyle":"Percent of total"
}
]
}
}
}
}
You have done this correctly, but unfortunately Power BI does not yet support title cardNames for any of their visuals.
I've voted on the Power BI Ideas page for this problem. Maybe you would like to as well :)

Adding footer for printing web pages and setting margins without media print

How can set bottom margin for web page without using class when document print.
for some reason i can not create document head. i cant use code something like this because i have no access to head of document.
#media print {
p.note {
bottom: 0; position: fixed;
}
}
If you can't, or, for some reason, don't want to use css #media, you can always use some jquery:
window.onafterprint = function() {
$("p.note").css("position","fixed");
$("p.note").css("bottom","0");
}; // IE5+
window.matchMedia('print').addListener(function(change) {
if !(change.matches) {
$("p.note").css("position","fixed");
$("p.note").css("bottom","0");
}
}); // Chrome 9+, Safari 5.1+
Here you can find some more info: http://tjvantoll.com/2012/06/15/detecting-print-requests-with-javascript/
And also there nearly exists a plugin: https://code.google.com/p/jmediatype/

Shorter URL in Groovlet

Consider the following Groovlet:
html.html
{
head {
title("Groovy Test")
}
body {
center {
img(src:"getPlot.groovy?name=name&value=value")
}
}
}
Is there a better way to generate the URL? I'm looking to eliminate the explicit var/vals from the URL.
You could use UrlRewriteFilter for this. It's like mod_rewrite but implemented as a servlet filter.