This issue only seems to occur since I upgraded from 1.5 to 1.6
The main JFrame, randomly seems to get stuck infront of every other application in windows.
Even another JDialog popping up set to alwaysontop(true) will be behind this main JFrame.
Any ideas on what could be causing this issue? / Any ideas for solutions?
Never had this issue before on Java 5.
Sorry guys it seems it was a program used as a screen splicer that was causing an issue with th Java program. Once the screen splicer was uninstalled, the issue has not occured.
I also have this issue for a long time now and was able to reproduce it.
While a modal always-on-top dialog is open in front of the frame, click the frame. The frame inherits the always-on-top behaviour, even if it is not set to stay on top.
I found an article about this behaviour here.
The simple solution: Dialogs must not be modal and always on top at the same time. Modalarity already includes an always-on-top-behaviour.
Related
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.]
I'd like to create a JavaFX application with MenuBar and I want my application to look more native-like, so I set useSystemMenuBarProperty to true. The application looks normal, like this (just ignore IntelliJ IDEA at background):
This is cool, and it works as it should. But when I minimize my application to the dock, the menubar starts to look like this:
As you can see, all buttons were disappeared, which is kinda strange.
The question is: How can I fix this? What do I have to do to make it look normal? Thanks.
This is indeed a strange problem which I actually haven't noticed before and I have no idea how to fix this. You should probably report this as a bug. At least the vanished part of the menu reappears when the window is made visible again, so this does not seem to be too serious, although it differes from the normal behaviour.
If you want to make your application even more native-like you should also have a look at https://github.com/codecentric/NSMenuFX which provides some additional features which are not present in JavaFX alone.
I've been having a problem with viewing my JFrames recently. I was able to view them just fine in the Design panel of Window Builder not too long ago, and now all that I see is just the JFrame options to minimize, maximize, or close the screen. Everything else around it is white. I am using a card layout on Juno Eclipse.
However, when I run the program, the small JFrame options to minimize, maximize, or exit appear. I am able to maximize my program and run it. The problem is that I can't seem to see where my labels or buttons are in design mode. Instead I just see white, which makes it difficult to do any editing.
This would be a lot easier if I was able to post pictures.
The problem you describe happens when you change the auto-generated code too much by hand. For example, adding too many method calls, or especially changing constructors, etc causes it to lose its ability to render the preview. This is one of the reasons I avoid using WindowBuilder as much as possible, because this is a known bug and as far as I know there is not a fix. I'm sorry for being the bearer of bad news, but unless you can find the added code that caused it to complain, and manipulate it a bit, you may be out of luck. The trick to getting WindowBuilder to work for you is to keep as close to the structure of the auto-generated code as possible.
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.
When my program starts up, the comboboxes (there are 2 that are having this problem) do show up. However, when I click on the arrow one item (there should be 7 items showing) shows up and there is no border around the list. If I drag my mouse over the area all the other items appear, but still no border.
This is only happening at our warehouse which is about 400 yards from the main office. We have fiber going over there and are on the same LAN. I'm not sure if this is a network issue or a java issue.
Any help is very much appreciated.
Chris
I remotely logged into the computer this morning to try this out for myself, with different versions of the package (one that was built using 1.4.1_18 and one with 1.4.1_15). Turns out that if I minimized the program and then maximized it, everything was fine (using both versions).
I commented out setExtendedState(getExtendedState() | MAXIMIZED_BOTH) which comes after everything is initialized for the frame. Rebuilt, restarted and the borders are there along with all the items, so it now works perfectly.
Does anyone know why this would be causing a problem?