Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JCheckBox behaviour on JDK1.5  RSS feed

 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a GridBagLayout where the first column is a checkbox column (JCheckBox with text added). When a checkbox is checked in any , that checkbox shifts to the right within the column by a pixel or two.

This is the code:

LayoutUtils.addComponent(chkBox, this, 0, 5, // x,y
1, 1, // width, height
GridBagConstraints.HORIZONTAL, // fill
GridBagConstraints.NORTHWEST, // anchor
1.0f, 0.0f, // wightx, weighty
new Insets(5, 5, 5, 5));

Here, this is JPanel

My checkbox details
=============
JCheckBox chkBox=new JCheckBox();
chkBox.setText("Hello");

Any idea?

thanks,
Guru
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

Don't forget to use code tags to format the code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!