All Questions

197
votes
11answers
34491 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
41818 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
29277 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?­­­­­­­­­­­­­­­­­­­­­­­­...
12
votes
4answers
2102 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 ...
13
votes
3answers
4859 views

Add a complex image in the panel, with buttons around it in one customized user interface

How can i have this image like below into the slavePanel and on top of that JPanel adjust the JButtons which looks like the image but having buttons correctly wrapped around? (Right now they are shape...
19
votes
2answers
21498 views

Making a robust, resizable Swing Chess GUI

How would I go about making this resizable Chess GUI? Our company has been tasked with making a Chess game. It needs to work on Windows, OS X and Linux/Unix machines, and we have chosen Java to ac...
14
votes
1answers
18299 views

How to use CardLayout with Netbeans GUI Builder

Preface (this is a self-answer post) I've gotten my feet wet with Netbeans GUI Builder but I am just not starting to dive in to it to learn the more intricate details. I really didn't even know hot ...
3
votes
2answers
1278 views

Why does the first panel added to a frame disappear?

Below is an example of adding two panels to a frame. Only one panel (the 2nd, red panel) appears. Why does the first panel disappear? import java.awt.*; import javax.swing.*; import javax.swing.b...
2
votes
2answers
2446 views

Only one component shows up in JFrame

As an improvement to my encryption project I decided to make a little GUI. However, when I run the program, only the top element shows up on the screen and it appears to obscure the others, though I h...
2
votes
1answers
5058 views

JPanel & components change position automatically

Hi I am working on swing application but I am facing one problem. When I first run application JPanel is positioned at proper position where I decided to set with components inside. But problem occu...

Previous Next