Is this a Swing Java 7 rendering bug?

In case the issue is caused by your graphics driver, setting one of the system properties below could help. Not quite sure if the props are still supported in Java 7.

Up vote 6 down vote favorite share g+ share fb share tw.

I made a simple Swing application. But the rendering behaves buggy. Have I done anything wrong or is it a bug?

It's simple a small JFrame with a textfield, button and an empty list. If I first resizes the window horizontally and then type in the textfield, the button suddenly disappear. Here is my code: public class App extends JFrame { public App() { JTextField messageFld = new JTextField(); JButton saveBtn = new JButton("Save"); JPanel inputPanel = new JPanel(new BorderLayout()); inputPanel.

Add(messageFld, BorderLayout. CENTER); inputPanel. Add(saveBtn, BorderLayout.

EAST); JList list = new JList(); JPanel panel = new JPanel(new BorderLayout()); panel. Add(inputPanel, BorderLayout. NORTH); panel.

Add(list, BorderLayout. CENTER); this.getContentPane(). Add(panel); this.

SetDefaultCloseOperation(JFrame. EXIT_ON_CLOSE); this. SetTitle("Test application"); this.pack(); this.

SetVisible(true); } public static void main(String args) { SwingUtilities. InvokeLater(new Runnable() { public void run() { new App(); } }); } } Here are a few screenshots: At start up After horizontal resize After typig a few charachers in the textfield After moving the mouse over the button I use Windows 7, Java 1.7.0 and Eclipse Indigo SR1. I used JDK 1.7.0.0 and have now upgraded to JDK 1.7.0.10 but I still have the same problem.

When I print the system properties I get this result: System.out. Println(System. GetProperty("java.

Version")); System.out. Println(System. GetProperty("java.runtime.

Version")); > 1.7.0_01 > 1.7.0_01-b08 java swing bugs java-7 link|improve this question edited Nov 10 '11 at 19:55 asked Nov 10 '11 at 15:02Jonas12.2k741102 97% accept rate.

1 weird, can't reproduce (jdk7, vista) – kleopatra Nov 10 '11 at 15:10 I also use jdk 1.7.0 and Windows 7 and the "Save" button is always displayed correctly. – toto2 Nov 10 '11 at 15:26 unable to reproduce with Eclipse Juno and Java 1.7.0-b147, also tried different L&F (Nimbus, Metal, Motif, Windows) – Carlos Heuberger Nov 10 '11 at 15:29 It's probably a bug from the graphics driver. I have an ATI card and no bug.

– toto2 Nov 10 '11 at 15:35 +1, it's a bug, for BorderLayout. EAST or BorderLayout. LINE_END.

Placing the component at any other place, won't lead to the problem. So seems like that area is buggy :-) – nIcE cOw 2 Nov3 at 10:02.

In case the issue is caused by your graphics driver, setting one of the system properties below could help. Not quite sure if the props are still supported in Java 7. Sun.

Java2d. D3d=false sun. Java2d.

Ddoffscreen=false sun. Java2d. Noddraw=true.

This solved this specific problem. But I got similar issues again when adding more components. – Jonas Nov 10 '11 at 19:56.

I am using eclipse helios service release 2, and java 1.6 and I am not getting that bug; it works fine for me. However it won't let me add parameters to JList...that may be because I'm using an older version of java...so basically with my setup and no parameters for JList it works...I'm not sure if this will help you, but those are my observations.

I got the same 'null result' also using Java 1.6. I suspect the OP is best off posting an SSCCE that starts the GUI on the EDT and dumps some basic Java version properties to the System.out. – Andrew Thompson Nov 10 '11 at 15:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions