SceneBuilder submenus unusable - java

Not sure if this is the correct place to ask. If there's a better SE site for that please let me know.
Ever since I've started using SceneBuilder it's sub-menus are completely unusable, as they disappear as soon as I move the cursor to select an option.
For example - say I want to change the font size for a label. I click on the "Font" property, which opens the family, size and style properties. Now I click on the size, which opens a drop-down list of sizes, but as soon as I move the cursor to a value the drop-down list disappears! It's as if SceneBuilder thinks I've given up on selecting a value, so it should hide the drop-down again.
The exact same thing happens, for example, when trying to change properties of effects, and anywhere there is a drop-down not in the main window.
I am using the latest (8.0.0) SceneBuilder from Gluon, although the exact same thing happened on Oracle's 2.0 (which is older and not maintained, as far as I could tell). I'm on Linux Debian 64bit, Java version 1.8.0_u40.
Any hint as to why this is happening, and how to solve it?

Normally SceneBuilder does not show such a behavior. I can only imagine that this behavior is triggered by some Linux Java bug. My suggestion would be to switch to Windows or Mac (probably not an option for you :-)) or at least use a more recent version of Java in the hope that this bug has been fixed in the meantime.

Related

Problem with JFace Application in design mode

I installed Eclipse IDE for Enterprise Java Developers 2020-09 with WindowBuilder 1.9.4. Then I tried to create a test application: SWT/JFace Java Project with a JFace ApplicationWindow.
My problem is that I cannot drop anything on the window directly in design mode. It is possible to add widgets to the main container in the components tree. But they seem to be hidden behind the parent shell (I could see this from setting a background color for it and when I add them I can see their bounds, but then no longer). It is not possible to resize the application window in design mode either.
However, when I do "Test/Preview...", the widgets are there. And also when I run the program, as they should as they are in the code. In the latter case also the resizing works (not with "Test/Preview..."). The resizing seems to work at first, but then it snaps back to a minimal size where only the menu and toolbar fit in the window,
This is so with any such project. I first tried to import a program I had written in an older version of Eclipse. There I have tabs in a composite in the container. They seem to be hidden, too (and misplaced, also behind the toolbar). But when I run the program, everything is fine. I first thought I might have messed something up in the program, so parsing gets sidetracked. But that cannot be it as the problem already arises in the simple test program where I have just one widget and the default code.
I have tried quite a few things to get around this, eg. reinstalled the IDE, installed an older version, installed an older version of WindowsBuilder in case this is a bug in either. But to no avail. Has anyone experienced the same problem? Seems like there is a simple mistake on my part. Something I would have to change in the settings or maybe the program?
But I have no idea where to look. Could it have to do with the JRE (OpenJDK15U-jdk_x64_windows_hotspot_15_36)? Had to take that as the download from Oracle does not work for some reason. There is a warning that it is not exactly compatible. But then the program works fine, so it cannot be at such a basic level? Any ideas very much appreciated as I am totally stuck at this point.
There is no problem with designing eg. a JFace dialog. Everything works as expected, I can drop widgets, resize, etc.
Here is how it looks:
Brute force "workaround": I go back to Oxygen where things are working fine. But somewhat of a defeat because I am stuck with an old version, which is a deadend. IIRC already going to Photon posed insurmountable problems for me (certainly my fault as I am not that good at the nitty-gritty). Would still be very interested in an answer to my question. Urgency is now lower as I can at least keep working on my program and let my frustration die down after two days of futile attempts.
[Edit: I only tried the resizing in Oxygen 32-bit, that worked, but did not check whether the problem with dropping a widget on the application window was also there. Then I tried to get the 64-bit version to run, which I could not do. There is apparently a problem with Java > 8. Installation of Photon worked finally. However, while resizing is okay there, I get the same problem with dropping widgets and that they appear to be misplaced (upper left corner of the area seems to be behind the toolbar. The "workaround" unfortunately went nowhere. So I am again more interested in an answer than I thought.]
[Edit 2 as per Oct 12: Since I could not solve this problem, I decided to redo the GUI with a SWT Application window. That lacks some of the functionality of a JFace Application window (I especially miss the ease of Actions). So it seems like a step backwards, and it caused some extra effort. But then the upside is that I had to rethink a few things about the structure anyway, which means I was forced to do that sooner than later. But still would like to get also JFace Application windows to run. Pressure is no longer there, but out of interest what went wrong.]

In Eclipse the text goes beyond page

I have a problem in Java Eclipse in that when I type a long sentence it goes beyond the border of my PC screen, so that I have to scroll to the right to be able to read a long sentence. I would like the text to stay within the screen, or within specific parameters, so that I don't have to scroll. Is there a way to do this?
I tried Googling a solution but can't find a way to get text to stay within screen limits :(
I found a button on the Toolbar.
In Eclipse ide 2019-03:
Toggle Word Wrap: Alt+Shift+Y
Depending on which version of Eclipse you use, there may be a way to enable Word Wrap.
In the question How do you enable word-wrap by default in Eclipse? Emmanuel Guiton explains that there is a setting which can be added manually to a preference file. Mickael states that Eclipse Neon uses the aforementioned shortcut.
Edit: Changed "Eclipse Oxygen ide 2019-03" to "Eclipse ide 2019-03"

HyperLinks Not Recognized in Java App for only one of many users

This is a strange problem and I could use some help figuring out what to do. I have a Java swing application that contains hyperlinks. I have dozens of users for which these links work just fine. However, I have a new user that cannot get the links to be recognized. That is when he hovers the mouse over one it does not change to a finger nor does clicking it do anything. Since this is the only user that has this problem I have to believe there is a setting somewhere that prevents links from working. He is using Windows 7 and Java 8. I cannot seem to find anything in the JRE settings that addresses this nor can I see anything in his AV software or OS settings either. Does anyone have any idea what setting and where might cause this behavior? TIA.

Blank but still somewhat working user interface

I've written a Java database program using Swing, and it looks and works fine on my Windows machine. I was expecting to be able to transfer it to my Linux (CentOS 6) machine with no problems, and while it compiles and runs just fine, the GUI is blank.
Specifically, a JDialog that I show appears as a solid grey rectangle, but I can still see my cursor change to an I bar when I hover over the text boxes, and I can type into them and press the invisible Ok button, and it works. (This is a database login dialog.)
Then, a JFrame that I've setup as an MDI parent is displayed, but it has zero size. If I drag it open it does have a border, but it does not visibly have the menu that I placed on it. I don't seem to be able to access the menu invisibly as I was able to on the JDialog.
I suspect that this must have something to do with some Java or library version, but I'm not sure. I tried installing Java 7 but it didn't change anything. I'm not sure if I should uninstall Java completely and try reinstalling it, or if maybe it has something to do with the project instead (I am using Eclipse Kepler if that helps.)
I see a few other "Java program is blank" questions, but they either do not have answers or are not the same issue I am having. (My program is only blank under CentOS so far; it works and looks just fine under Windows.)
I narrowed it down to a single line. In the JDialog I had the following:
setType(Type.POPUP);
as soon as I removed this line, the dialog became visible.
Additionally, I find that if I use the Test/Preview... feature (this is using the WindowBuilder) when that line is present, it shows the dialog blank, but it is non-interactive and effectively hangs Eclipse. This led me to "end-task" java.exe, which did unfreeze Eclipse, but it ended up causing even more problems, including the ones I was having with my MDI JFrame.
After rebooting, and removing the above POPUP line, everything is working great.

SingleFrameApplication that does NOT require ALT to activate menuitem mnemonics?

In the NetBeans 6.9 IDE, if you create a
New Project >> Java >> Java Desktop Application and run it, you will find that the menu items have mnemonics, but only after ALT is pressed.
(The netbeans program itself uses this style of menu.)
However, if you create a new File >> Swing GUI Forms >> JFrame Form, and add a simple menubar with mnemonics, then run the JFrame, the mnemonics will always appear without having to press ALT. This is what I would prefer.
(Firefox uses this style of menu)
My thoughts are that the org.jdesktop.application overrides the default setting, but that's just a guess. Anyone know how to make a SingleFrameApplication not require ALT to be pressed?
Thanks.
Edit:
The problem was found to be that JFrame and JDesktop use different default Look and Feels
It's a Windows setting. In XP go to:
Control Panel
Display
Appearance
Effects
Hide underlined letters for keyboard navigation until I press the Alt key
(Win7 should have a similar setting somewhere, I suppose.)
The default setting is on, so Java is right and Firefox is wrong (even Office 2003 doesn't respect that setting).
Uncheck it and you'll always see mnemonic underline in Java.
Note that only Windows LAF correctly respects the setting. Motif and Metal always show the underline. I don't use NetBeans or jDesktop but I guess it uses system LAF and thus the underline is correct.
If you still want to always show underline under Windows LAF (please think twice before you do), call UIManager.getLookAndFeelDefaults().put("Button.showMnemonics", false), which does NOT seem to work for XP because WindowsMenuItemUI#paintText only checks the flag under Vista. You could check Win7 JDK yourself.
Note that there's an accepted bug when the setting is on, which goes like this (saving you some time to parse the 2nd most awful bug tracking system in the universe. The worst is an in-house ColdFusion system my company used to have): create one menu with mnemonic, for example &File, press Alt-F, release, press Alt-F again, the underline is gone. They are back as soon as you do anything else, clicking, or just press Alt by itself.

Categories