Java, why do my lines always white out in BlueJ? - java

While typing my code out, some lines automatically get spaced out, and whenever I try to click or type something, more lines disappear in the process, therefore making me delete the class itself.
I have encountered this same issue on another system.
I cannot even Ctrl+A my code, help!
Screenshot:

The BlueJ FAQ mentions possible display artifacts on Windows:
There are visual artifacts on the BlueJ windows (black areas,
distorted text, etc) in Windows
Visual artifacts - black areas,
distorted or missing text, etc - are usually a result of either a
display driver bug or a Java bug. Try updating your display drivers
(see here for Windows 7) or disabling graphics acceleration (see
here).
https://bluej.org/faq.html#win_visual_artifcats
It makes several recommendations for how to fix them:
update display drivers
update JDK
change VM args
Read the linked FAQ for instructions.
The release log also tells a similar story, so make sure you've updated BlueJ:
4.1.0 23 June 2017
Major fixes:
Fixed: Graphical display bug could cause the Java editor and other
windows (e.g. Terminal) to turn white and not redraw correctly.
https://bluej.org/versions.html

Related

Netbeans 12.0 Not showing errors and attribute colors in java classes

I am currently working on a project for my first java team project. I have run into an issue where a certain class will suddenly stop showing errors (when I try to build my project, the output will show an error as shown in the screen capture, but I won't see an error in the text editor). I wrote a bunch of nonsense at the last line for you to see what I mean. Also, my attributes normally show in purple text and they now show in white text which is normally the indicator that the class in question won't show errors. This only affects some classes, most of them I worked on recently and have not been committed and pushed to my gitlab repo.
This makes coding a pain since I never know if I have made a stupid mistake until I try to build the project. I have not fiddled with the IDE, the only thing I did was change the font to the Jetbrains one and put on the default Netbeans dark theme.
Any help would be appreciated.
Try to delete Netbeans Cache folder (after closing Netbeans of course). On Windows systems it is usually located under C:\Users\<<username>>\AppData\Local\NetBeans\.

Java 9 on Windows with large fonts

If you set large fonts (for example, 125%, 120 DPI) on Windows, then it looks as if Swing of Java 9 first renders into a smaller image and then scales this image to the screen.
Text is still properly displayed. But 1 pixel lines are times 1 pixel or 2 pixels strong. A diagonal line is stepped. Icons are rasterized.
Are there any command line parameters or API to change this behavior?
Example Edit:
Using MenuSelectionManagerDemo from docs.oracle.com/javase/tutorial/uiswing/examples/components/
I ran that Swing MenuSelectionManagerDemo using Java 9 and Windows 10, and the issues you raised appear to be resolved. See the two screen shots below, where I ran with scaling set to 100% and 125% respectively.
As I pointed out in a comment to the OP, it looks like this was resolved by a JDK bug fix several months ago, which I assume was raised by the OP:
https://bugs.openjdk.java.net/browse/JDK-8174845
One other minor point worth noting is that changing the Windows setting from 100% to 125% is a change to "Scale and Layout", and will "Change the size of text, apps and other items". (i.e. It is far more than just a font change, as mentioned in the JDK bug response.)
I found that on Oracle Java 9,10,11,12 and Amazon Corretto Java LTS (jdk 11.0.2_9) and the rasterization problem with icons/pictures are still a valid case and not fixed! Is this bugfix merged to trunk really?
Last version where this problem is not occurred is Java 8.0_202 where still everything goes well.

Lot of issues with Eclipse mars and java-openjdk8 under ubuntu 16.04

Are there any known issues regarding Eclipse Mars (4.5.2) under Ubuntu Mate 16.04 and java-openjdk8?
-Since upgrade, the GUI is responding VERY slow (a real handicap so far, taking away all the coding fun)..
To be more specific, for example, any hover mouse-action does not work unless waiting several time with cursor on the text.
-And the console does not update itself sometimes.. Which mean, if i run, i have to change the view and change it back (e.g. click on 'snippets'-tab and then on 'console' again.
-If the console print any links to classes (e.g. in error-logs) They do not work until i change the view again (which means click on the link-->click on the tab 'snippets'. Then the linked class gets opened.
It's so strange that i think of downgrade again (ubuntu15.10, java-openjdk7) But i also upgraded to android studio 2.1 which needs java8 jdk..
Edit:
Codecompletion does not work. I wonder wtf? Simply nothing works.
All issues are temporary thus not to reproduce or to describe more detailed.. Its very very unstable.
Did i miss something? Is some of the listed software incompatible?
Most of the problems due to new GTK3 library/default theme used. Switch to GTK2 will resolve the problems. See this bug.
How to force eclipse to use GTK2

Sikuli issue - capturing an area

What I am trying to accomplish is to select an area on the screen with the mouse (outside of the may frame) and get the resulting region coordinates using Sikuli.
The code that should do this looks is below:
Screen screen = Screen.getPrimaryScreen();
Region region = screen.selectRegion("Select the area.");
What happens is that the cursor turns into a selector cross (the ones you usually see when you expect this function), but I can't select the area and actually the only way I can get back from the application is by killing it. Not too many examples I have found so I am asking for help here.
How can I make this work?
Also one other question:
I have downloaded the following script version:
Sikuli-IDE-1.0.0-Win64.zip
This means if I want to create a crossplatform solution I have to include like 6 jars? I have found a more universal Java API it seems (that is what it is called actually):
https://code.google.com/p/sikuli-api/
With all required supported OS but I can't find a single example on what I am trying to do that is similar to the little code snippet I pasted here. The sikuli script I am using now and this Sikuli API (apparently not the same) seems to be just different enough to amke this difficult.
Any suggestions? Thanks a lot in advance.
As it turns out, this only happens if I put this functionality on a Swing button's actionhandler. I have reported the bug to Sikuli and it will be probably fixed in the next release.

UI components of java programs appearing as blank boxes

As I run Java programs (like DbVisualizer and OpenProj) on my computer, some UI components like buttons, images, check boxes, scrollbars, etc. show as blank boxes. Not rarely some of these components first appear normally when you open the program and then go blank as you mouse over them.
I have already updated JRE and video drivers and also tweaked JAVA_OPTS with -Dsun.java2d.noddraw=true;-Dsun.java2d.d3d=false;, as recommended in Java forums, but none of these proposed solutions have worked so far.
I don't believe this is an OS specific issue, since I checked some other PCs with the exact same configuration of OS (Windows Vista) and hardware and many of them don't present that problem.
A screenshot of this situation can be seen here:
Any ideas?
Those JAVA_OPTS must be separated by spaces and not semi-colons!
Connect to the application with jVisualVM and verify that the "JVM Arguments" section contains all your desired options.
While using windows basic theme I would often find numerous graphical glitches. Moving a window would create a trail behind itself over background windows and UI controls at times would not appear until moused over.
As already suggested, try using the windows aero theme and just turn off transparency if you don't like the aero look.
This does seem more like a graphics driver issue. Note how things that are missing are images (icons, checkboxes) which are drawn by transferring the bitmap data directly to the graphic card. The sun.java2d.noddraw=false and sun.java2d.d3d=false are more of a hacks in this case, really.
What I would do is:
check if I am using the latest version of Java (wouldn't hurt to switch to a 64-bit java if you are using a 64-bit system)
check your graphics drivers, make sure they are the latest version
check Windows service packs
Also try using changing the Look and feel; maybe this will help.
I suspect that disabling DirectDraw will fix this and your attempt to disable it was unsuccessful.
As noted by Ryan, the options appear to be formatted incorrectly. Remove the semicolons and put a space between, or better still, only use sun.java2d.d3d=false. The sun.java2d.noddraw flag was obsoleted Java SE6u10 and setting to true now has the same effect as setting sun.java2d.d3d=false. There is no need to set both.
The effect of the incorrect formatting can be seen in the code below:
public class WrongArgs {
public static void main(String[] args) {
System.out.println("sun.java2d.noddraw: " + System.getProperty("sun.java2d.noddraw"));
System.out.println("sun.java2d.d3d: " + System.getProperty("sun.java2d.d3d"));
}
}
Running this code with args: "-Dsun.java2d.noddraw=true;-Dsun.java2d.d3d=false;" produces:
sun.java2d.noddraw: true;-Dsun.java2d.d3d=false;
sun.java2d.d3d: null
Running with args "-Dsun.java2d.noddraw=true -Dsun.java2d.d3d=false"
sun.java2d.noddraw: true
sun.java2d.d3d: false

Categories