trouble with a javafx menu style - java

can someone tell me how i can fix this padding/shadow like effect around my MenuItems?
I dont know the Name of it so a research was hard without an exact name of it:
http://imagizer.imageshack.us/v2/150x100q90/901/GyPRgA.png
This gradient isn't part of my stage background its a background which opens with the Menu like a Container holding the Menu.
Sorry guys its hard to explain hopefully you can help me.
The screenshot i cant post fully since i got only 1 reputation so i add a link to it
Thanks in advance.

Since i was playing around trying to figure my problem while waiting i felt onto the solution for it.
For those which have the same Problem:
Solution:
Since the new Modena style is used by default, the context menu's are styled with a drop shadow / Gaussian blur effect, which made when opening the Menu it gave some kind of strange effect when using an other background on the stage.
To solve this its only needed to overwrite(resetting) the style..
in my case it was the follow one which i needed to overwrite in a new css file.
-fx-effect: dropshadow( gaussian , rgba(0,0,0,0.2) , 12, 0.0 , 0 , 8 );

Related

How to make checkbox without a background programmatically?

I'm new to Android development and I'd like help from the experts here.
I make my checkbox change its background color to red upon a specific condition, and then I need to return its background color to the original one. I've tried the following code, but it gives me an error, so I'd like to know the correct code for doing so?
I have tried various ways, but nothing helps me solve my problem.
Female.setBackgroundColor(Color.parseColor("#null"));
Male.setBackgroundColor(Color.parseColor("#null"));
This sets the color to transparent what is the same as setting the background to #null:
Female.setBackgroundColor(0x00000000);
Male.setBackgroundColor(0x00000000);
Can be simplified by using just 0 but I think it is easier to understand if there is the ARGB code.

Eclipse -> Java -> GUI Builder -> Can't get my UI to show properly in design mode

I am new to Java and Eclipse.
Somehow, my ui is not showing up the right way. Instead of seeing my frame, with the x to close at the top right, etc, and all the controls, I see a frame with no border.
See here: http://s7.postimg.org/miprf5ul7/Noooooooooooo.png
Here's my code: https://www.dropbox.com/s/74mltgsxcs9vjnf/PDF%20Monster.zip
I've spent countless hours working on this.
Please help me restore my UI, I'm desperate.
Thank you,
Whenever you can't view your ui the right way look at the code to see if there's red blocks in the right side. This indicates errors that may cause this.
In my case I had deleted a semicolon by accident somewhere...
If you fix the errors, it should be fine.
Also, you can simply try to comment out the errors to see if you can see the ui.

+Android Webview - how to autoscroll a page?

I'd like to open a html-page in a webview and make it auto-scroll downwards automatically in accordance with an interval set through a timer.
Although below example is for desktop, this link should give you an idea what I want to achieve (enable autoscrolling in the upper right part of the page):
example
First I thought about opening a webpage and then use some kind of code which would simulate/trigger DPAD-down (or Arrow-down). In Windows Mobile, I believe there was something called SendKeys but I couldn't find something similar in the Android-SDK (except for a test-SDK which I doubt I could use for publishing my app in AndroidMarket) so I guess the way mentioned above is not possible.
Another solution could perhaps be a java-script but the webpages are not created by me so I can't insert any anchor.
However, I noted that Webview has some methods called PageDown (and PageUp) which could also be a solution but I am afraid a PageDown would be too much for scrolling the way I want. I want the scrolling to be slow and smooth, more like a line at a time.
Do you have any ideas how I could implement this? I'd really appreciate your help.
You could try using,
View.scrollBy(int x, int y) to scroll the WebView.Use:
computeVerticalScrollOffset(),
computeVerticalScrollExtent() computeVerticalScrollRange() to calculate a maximum y value.

Swing: problems with component's background

I've got a problem, that swing components in different parts of program have sometimes wrong background. For example this or this.
As I mentioned, the bug is not permanent and it can appear in one place one time and never after. But still there are some places, where I can randomly reproduce it. Unfortunately, I don't see any solutions.
Has anyone some ideas how can I fix it?
If you set your components to non-opaque (I think the call is setOpaque(false)), that will let the background colour of the component that it is on top of show through.
in addition to what Paul said, there's the question if you use self made components.
Such components should take care of their complete occupied region (or at least the invalidated regions) in the paint callback. An error seen quite often that leads to strange artifacts when moving or resizing is that only "important" parts are repainted, for example a string to be shown, without drawing the background.
In this case, anything previously blitted ther will show through.

Programmatically Scroll an SWT Table horizontally

Similar question, but not exactly the same.
table.showColumn() is helpful, but the scrolling only has the granularity of the column width. But I want a more precise control of the scroll location.
Consider the following use case. I have two tables that I know are of the same width and have the same column widths. And I want to implement some kind of a scroll synchronizer so that when the user scrolls one table (horizontally), the other table scrolls to the same location.
EDIT:
On the Eclipse forum there seems to be the same question and some working ideas, but no resolution.
EDIT:
I discovered this behavior on Windows
The method setOrigin(x,y) in ScrolledComposite should help:
Scrolls the content so that the specified point in the content is in the top left corner. If no content has been set, nothing will occur. Negative values will be ignored. Values greater than the maximum scroll distance will result in scrolling to the end of the scrollbar.
I'm afraid I can't get a satisfying result in Windows Vista/7 either, but felt I was getting close.
I believe you will have to grab the Table's horizontal scroll bar by using table.getHorizontalBar(). Then, you can specify scrollbar.setSelection() to make it move to a specified position.
This is where I get stuck. Somehow, you have to notify either the Table or the ScrollBar that the value has changed. I've tried everything from update() to notifyListener(), but no dice. It seems that it is merely a matter of laying out, but layout() doesn't have any effect, either.
Incidentally, bear in mind that the ScrollBar's parent (type Scrollable) is not a ScrolledComposite like I had expected, but is actually the Table itself.
I hope this gives you some ideas and helps you find a solution. If so, please let me know, since it's bugging me now, too!
Having poked around in the ScrollBar source a bit, it looks like there are numerous (windows) bugs that have been overcome at one point or another. This may be another, though you didn't mention your OS, nor did Paul, so it's hard to tell.
All the "change the scroll bar position" functions end up calling SetScrollInfo which is package private. I suspect that the intention is for this to actually update things the way you want.
None of that solves your problem. Thankfully the same source also hints at a solution:
Slider.
You'd have to reimplement all the scrollbar behavior within slider, but once done, that should give you the control (har) you want. Hopefully. OTOH, you may run into exactly the same OS bug (if bug it be), and be back at square one.
At THAT point, you definitely register it as an Eclipse UI bug.
PS: Have you searched the Eclipse Bugzilla for anything similar? Poking around a bit turned up this bug related to the scroll bar being out of sync with a tree view in the Navigator (on PC Linux-Motif, but working fine in Windows). I suspect you'll find similar issues if you dig a bit more.

Categories