JDK 1.8 displays swing distortion, fixed in JDK 1.7

I installed IntelliJ IDEA (13.1.1 # IC-135.480) and JDK 1.8.0 (x64), and I generated some GUI with the GUI Form designer.

Then I ran the code and realized that something was wrong.

Here is a screenshot of my GUI: Buggy Rendering JDK 1.8.0

Rendering the font does not seem to be in order. In addition, Button loses its text when I click on it.

So, I installed JDK 1.7.0_40 (x64), recompiled the project, and ran it again.

When using JDK 1.7, the following form appears: Rendering OK JDB 1.7.0_40

The rendering seems OK, and the button is fine too.

So, I installed the latest Graphics and Chipset drivers and more, but the problem still exists. Have you had such problems with Java Swing interfaces? Could you help me solve my problems? Any help would be greatly appreciated.




UPDATE:

I created a small project with only 1 JTextArea and 1 JButton, and I have the same rendering problems.

According to Andrew Thompson, I changed setSize () and I started with EDT. Example below:

package at.maeh.java.client.simpleTextClient; import javax.swing.*; import java.awt.*; public class SimpleClient extends JFrame { private JPanel panel1; private JTextArea textArea1 = new JTextArea(); private JButton button1 = new JButton(); public SimpleClient() { super("SimpleClient"); // Panel panel1 = new JPanel(); panel1.setLayout(new FlowLayout()); // BUtton button1.setText("TestButton"); // TextArea textArea1.setColumns(40); textArea1.setRows(15); // Add Components panel1.add(textArea1); panel1.add(button1); // Add to Frame this.getContentPane().add(panel1); // pack and set Visible pack(); setVisible(true); System.out.println("Constructor EDT: " + SwingUtilities.isEventDispatchThread()); } public static void main(String[] args) { SwingUtilities.invokeLater(SimpleClient::new); System.out.println("Main EDT: " + SwingUtilities.isEventDispatchThread()); } } 

The result is a simple JFrame with components in it.

SimpleClient -> Screenshot immediately after Start

When I write some text or urinate my mousePointer over Button, the components are obtained in this way (Text: testsentence.123; Button-Label: TestButton)

after writing - or mouse over

+52
java java-8 swing rendering nvidia
Mar 29 '14 at 22:08
source share
8 answers

Finally, I found a solution to my problem. I had to change the power management settings of my NVIDIA GeForce 620M for maximum performance.

+12
Apr 01 '14 at 16:11
source share
— -

For those whose problem has not been resolved; try this solution:

Set the global environment variable "J2D_D3D" to "false" inside the OS. According to Sun, this option is used to disable the use of Java Direct3D 2D systems in Java 1.4.1_02 and later.

those. just create an environment variable named "J2D_D3D" and set to false without quotes.

this solved my rendering problems, hope it is yours too.

+47
Oct 28 '14 at 2:00
source share

You can do the following:

  • Right-click on the desktop and select the NVIDIA Control Panel
  • Select "Manage 3D Settings" in the left pane
  • Select the "Program Settings" tab in the main window
  • Click Add
  • Go to the java folder (C: \ Program Files \ Java \ jre1.8.0_20 \ bin) and select javaw.exe and press "open" (this step will probably depend on your operating system, but should be fairly simple to find)
  • Where he says: “Choose your preferred graphics processor for this program,” click the drop-down list and select “NVIDIA High Performance Processor.”
  • Click "Apply" in the lower right corner and you will be fine.
+9
Jan 04 '15 at 17:34
source share

I have exactly the same problem. What I found after setting up Duffys quality settings:

My laptop works with both the Intel HD 4000 and the NVS 5200M. Running Swing applications with Java 7 is great for both boards. With the Java 8 Swing GUI displayed on the Intel card (regardless of quality settings), they look crashing (like in the duffys screenshot), using the NVS 5200M, they look the way they are used to.

Could not find anything on the java error tracker, on the other hand it is difficult to describe this error.

+8
Apr 02 '14 at 15:16
source share
 textArea1.setSize(500, 300); 

There is a problem. The Java GUI may have to work on multiple platforms, at different screen resolutions and using different PLAFs. Thus, they do not facilitate the precise placement or calibration of components. To organize components for a robust GUI, instead use layout managers or combinations of 1, along with layout and borders for space 2 .

  • Jaqap.png
  • NVtKI.png
+2
Mar 30 '14 at 2:01
source share

Dell Vostro 5480 with ubuntu mate 16.04 I had a similar problem. He fixed the Nvidia driver change using an additional driver.

enter image description here

And select your NVidia profile. enter image description here

+2
Nov 17 '16 at
source share

Similar fix for duffy356:

Lenovo T430 with 64-bit version of Windows 7 with NVIDIA NVS 5200M along with HD 4000. Update for updating on Java 8 5 created graphics and button damage for two Swing, jEdit and Freemind applications.

Using the NVIDIA Control Panel applet to change the global settings for the power management mode to “Preferred Maximum Performance” looks like this problem has been fixed.

Not sure if there is a hidden issue with how apps set sizes.

+1
Jul 07 '14 at 12:18
source share

actions:

  • control Panel
  • system and safety
  • system
  • Remote Settings
  • Advanced tab
  • click environment variables
  • create variable J2D_D3D
  • and set the value to false.

worked for me, ....

-one
Jun 15 '16 at 10:19
source share



All Articles