Problem with JFace Application in design mode - java

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.]

Related

Elements in Eclipse WindowBuilder Look Old

So, I'm making a window in WindowBuilder with Eclipse Photon, and this is the GUI:
It looks pretty normal. However, when I run the program, I get some Windows Vista-looking design:
It used to show up regularly, but for some reason it has changed, any idea what triggered this, and how to get it back?
P.S Just so you know, in case this proves useful, I am using Eclipse Photon, but for personal reasons, I installed Eclipse Neon about twenty minutes ago. My thinking is maybe Eclipse Neon changed it during installation, is that right?
I think you have to fiddle with the look and feel with Swing [1]. You can also switch to SWT which uses the native widgets as much as possible instead of drawing each widget itself.
[1] https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

Eclipse Oxygen: set cursor color (to black)

After an update my Eclipse Oxygen picked white for a cursor color, which makes it almost invisible. So, instead of doing my work, I'm spending a Monday morning trying to get it back to normal - black, that is.
There are possible workarounds, like making the line background color darker, but I want to fix in a regular way.
I'm using CentOS 7.3 + Gnome. OS was also recently updated, and there were changes to the appearance. So I'm not sure, is it about OS or Eclipse. Tagging both.
Have someone had the same issue and fixed it?
I first tried to reproduce the issue on a VM. It worked fine, thus narrowing the problem to specific hardware and drivers.
Solved it by installing the vendors graphic card driver (NVIDIA), replacing nouveau. There is a bunch of pages describing the process, here is one:
http://www.advancedclustering.com/act_kb/installing-nvidia-drivers-rhel-centos-7/
So, it is not really a Stackoverflow question. If only I knew beforehand :).

Artifacts when drawing Qt & Java apps after durable work on Ubuntu 15.10 (and other)

Short history of problem:
After upgrading to Ubuntu 15.10 I had some problems with any Qt-apps after durable work with IntellijIDEA. In apps like tortoisehg I saw painting problems, like not filled areas or shifted text. It was fixed after reading post in archlinux forum. Just set up property for Qt and changed my openjdk to oracle's.
The next story, that possibly is relative to first, consists in my work in IntellijIDEA and other Java swing applications (like Netbeans RCP): after long term working some dialogs became transparent, were inaccessible or just clicked through it to something under. Reopen of the dialog or window helps, but my colleagues have same problems on other OS, like Fedora (with KDE).
This bug is annoying, because our product is written on Netbeans and works under *nix distributive. Sometimes we stuck with problem of click-through problem: dialog or window just clicked into window after it.
I think the problem in wrong settings of x-server and in Qt- and Java- toolkit clash. This leads to artifacts on both application groups.
Does anybody stuck with this problem and do you have some ideas to resolve it?
The possible reason is described in Russian here (https://toster.ru/q/267833?e=3090918#clarification_329784).
Some bugs of it are found in:
https://bugs.kde.org/show_bug.cgi?id=350976
https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/1512760
Summary: the Java and Qt applications use shmem that is never cleaned by Java, after some time Qt cannot use this memory to work right. Google it with words «Java Qt shmem».

Eclipse Debugger will not show the shared area

I've had this error before in pydev perspectives in the past, and the only solution I've ever managed was to remove the broken perspective and start a new one.
The problem is this:
Normally the different panes of the workspace can be minimized, maximized, and regular size. Right now, I cannot get the "shared area" code section of the debug perspective to show up at all. I can peak at it while it's minimized, but that's all I can manage.
What's more, eclipse automatically switches to debug, so it's basically impossible for me to debug code right now.
I'd really like to know why this is happening to me, and how to avoid and/or fix it.
Also, I'm currently running java 7, I have not updated yet.
You can go to Window, Reset Perspective which will give you your shared area back, although also obviously reset any other views you may have.

Java 7u55 on mac breaks SWT Web Start app

We have happily been deploying our cross-platform SWT app with Web Start for years. On the mac we had to switch from using -XStartOnFirst to using the com.apple.concurrent.Dispatch class to get SWT to run in the first thread.
Java 7 update 55 breaks our app again, and again it seems to be Web Start related.
The app starts and displays all windows, but all interface interactions don't have an effect until you click some other widget. For example, if I click a tab to bring it to foreground, I have to then click another widget to finally get the first action to fire. This is probably threading related, like most SWT/Web Start problems but I have no workaround for this problem other than stay away from 7u55. Has anybody experienced this problem and found a workaround?
EDIT: It seems the problem stems from our use of JNA, which we use to get the idle time from the OS using CGSSecondsSinceLastInputEvent. I get a NullPointerException in JNLPClassloader in the logs. If I comment out the code that uses JNA, the problem goes away. Since Oracle seems to be paranoid with security these last months, I'm guessing there is a problem with the jna jar. I sign all jars with the same cert, but maybe there is a new manifest attribute that I should be looking at. Anybody have any ideas?

Categories