Java Code Examples for javax.swing.JCheckBox#setMinimumSize()

The following examples show how to use javax.swing.JCheckBox#setMinimumSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NullableObject.java    From jclic with GNU General Public License v2.0 6 votes vote down vote up
/** Creates new NullableObject */
public NullableObject() {

  super(new java.awt.BorderLayout());
  setOpaque(false);
  nullValue = true;

  check = new JCheckBox();
  check.setPreferredSize(checkDim);
  check.setMinimumSize(checkDim);
  check.setFocusPainted(false);
  check.setSelected(false);
  add(check, java.awt.BorderLayout.WEST);

  button = buildButton();
  button.setPreferredSize(btDim);
  button.setMinimumSize(btDim);
  button.setFocusPainted(false);
  add(button, java.awt.BorderLayout.CENTER);

  check.addActionListener(this);
  button.addActionListener(this);
}
 
Example 2
Source File: GUIOptionPrivateDNS.java    From PacketProxy with Apache License 2.0 5 votes vote down vote up
private JCheckBox createCheckBox(){
	checkBox = new JCheckBox(I18nString.get("Use private DNS server"));
	checkBox.addActionListener(e ->{
		if(checkBox.isSelected()) privateDNS.start(new DNSSpoofingIPGetter(this));
		else privateDNS.stop();
	});
	checkBox.setMinimumSize(new Dimension(Short.MAX_VALUE, checkBox.getMaximumSize().height));
	return checkBox;
}