Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JFrame display problem under eclipse + Linux(JFrame display problem when launching from eclipse under Linux)
JFrame display problem under eclipse + Linux [message #1800573] Wed, 02 January 2019 18:13
Frédéric Baldit is currently offline Frédéric BalditFriend
Messages: 1
Registered: January 2019
Junior Member
index.php/fa/34596/0/Hi,

I have experienced the following strange problem when running a simple program displaying a JFrame from eclipse (under debian stable): the displayed window shows a black right border, just as if it had not been completely drawn, as shown by the attached image. The following minimal example gives (randomly, but quite often) the bad image:
import javax.swing.*;

public class TestJFrame extends JFrame{

	public static void main(String [] args) {
		JFrame fen = new JFrame("fenetre");
		fen.setSize(200, 150);
		fen.setVisible(true);
	}
}


I found that when running the application directly from the command line the "bug" disappears, and also that running the same program under netbeans or Intellij Idea (under Linux) doesn't fix it. Amazingly, when running from Eclipse+Windows the window is always correctly displayed (didn't try under Mac Os X).

Remark: when resizing the window with the mouse the window is correctly redisplayed.

Finally, I found how to fix this behavior by slightly changing the source code (but this doesn't explain why the first program gives with a bad display):

import javax.swing.*;
import java.awt.*;

public class TestJFrame extends JFrame{

	public static void main(String [] args) {
		JFrame fen = new JFrame("fenetre");
		fen.setPreferredSize(new Dimension(200, 150));
		fen.pack();
		fen.setVisible(true);
	}
}


Could anyone explain precisely to me why I experiment this «bug». It seems to be related to the association eclipse+Linux (more precisely eclipse + gnome window managing system).

Thank's in advance for any help,
Frédéric.

index.php/fa/34596/0/
  • Attachment: fenetre.png
    (Size: 1.79KB, Downloaded 828 times)
Previous Topic:jdk or eclipse manipulated due to an pseudo blackhat
Next Topic:polling news feeds problem
Goto Forum:
  


Current Time: Thu Apr 25 15:29:30 GMT 2024

Powered by FUDForum. Page generated in 0.02896 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top