All Questions

456
votes
9answers
95331 views

The Use of Multiple JFrames: Good or Bad Practice?

I'm developing an application which displays images, and plays sounds from a database. I'm trying to decide whether or not to use a separate JFrame to add images to the database from the GUI. I'm ju...
197
votes
11answers
34453 views

How to add JTable in JPanel with null layout?

I want to add JTable into JPanel whose layout is null. JPanel contains other components. I have to add JTable at proper position.
416
votes
8answers
41782 views

Should I avoid the use of set(Preferred|Maximum|Minimum)Size methods in Java Swing?

Several times I've been criticized for having suggested the use of the following methods: setPreferredSize setMinimumSize setMaximumSize on Swing components. I don't see any alternative to their u...
127
votes
5answers
29215 views

Providing white space in a Swing GUI

A GUI with no white space appears 'crowded'. How can I provide white space without resorting to explicitly setting the position or size of components?­­­­­­­­­­­­­­­­­­­­­­­­...
67
votes
4answers
3578 views

Java GUI listeners without AWT

I am a starting Java developer, learning just from internet tutorials. I am learning full screen GUI applications. I was told yesterday that I shouldn't use AWT in my programs, because it is outdated....
117
votes
2answers
34425 views

GUI not working after rewriting to MVC

I'm practicing MVC style programming. I have a Mastermind game in a single file, working fine (maybe apart of the fact that "Check" button is invisible at start). http://paste.pocoo.org/show/226726/ ...
44
votes
3answers
37122 views

Loading image resource

I am having a error for my GUI. Trying to set title bar icon then be included in a Runnable JAR. BufferedImage image = null; try { image = ImageIO.read(getClass().getClassLoader().getResource("re...
12
votes
4answers
2097 views

Why is it frowned upon to use a null layout in Swing?

Recently, I started creating a program for the company I work for. Just as background info, I'm still a student and a beginner programmer, so my solution is probably not recommended and I didn't know ...
113
votes
2answers
21569 views

How to best position Swing GUIs?

In another thread I stated that I liked to center my GUIs by doing something like this: JFrame frame = new JFrame("Foo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane()....
17
votes
4answers
20893 views

Java: maintaining aspect ratio of JPanel background image

I have a JPanel with a painted background image and a layout manager holding other smaller images, all of this inside a JFrame. The background image is pretty big and I want to be able to have it main...

Previous Next