private JCheckBox createCheckbox(JPanel section,String name, int y_pos) { JCheckBox checkBox = new JCheckBox(name); checkBox.setBounds(10, y_pos, 450, 20); section.add(checkBox); return checkBox; }
private JCheckBox createCheckbox(JPanel section,String name, int y_pos) { JCheckBox checkBox = new JCheckBox(name); checkBox.setBounds(10, y_pos, 450, 20); section.add(checkBox); return checkBox; }
private JCheckBox createCheckbox(JPanel section,String name, int y_pos) { JCheckBox checkBox = new JCheckBox(name); checkBox.setBounds(10, y_pos, 450, 20); section.add(checkBox); return checkBox; }
private JCheckBox createCheckbox(JPanel section, String name, int y_pos) { JCheckBox checkBox = new JCheckBox(name); checkBox.setBounds(10, y_pos, 450, 20); section.add(checkBox); return checkBox; }
private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 450, 300); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null); JPanel panel = new JPanel(); panel.setBounds(0, 0, 434, 261); frame.getContentPane().add(panel); panel.setLayout(null); JCheckBox chckbxCheckbox = new JCheckBox("checkbox"); chckbxCheckbox.setBounds(44, 41, 97, 23); panel.add(chckbxCheckbox); JCheckBox chckbxCheckbox_1 = new JCheckBox("checkbox 2"); chckbxCheckbox_1.setBounds(197, 41, 97, 23); panel.add(chckbxCheckbox_1); }
private JCheckBox Ketchup; private JCheckBox Garlic; public ClassName() { Ketchup = new JCheckBox(); Ketchup.setText("Ketchup"); Ketchup.setSize(50,25); add(Ketchup); Ketchup.setBounds(175, 100, 175,25); Garlic = new JCheckBox(); Garlic.setText("Garlic"); Garlic.setSize(50,25); add(Garlic); Garlic.setBounds(175, 120, 175,25); }
private void createOutputSettings() { enableZipEncodingCheckBox = new JCheckBox("Activate Zip Encoding"); enableZipEncodingCheckBox.setBounds(10, 160, 200, 25); enableZipEncodingCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { boolean flag = !controller.isZipCompressionEnabled(); controller.setEnableZipCompression(flag); validateSettings(); } }); this.add(enableZipEncodingCheckBox); }
private void createStatsOutputSettings() { statsOutputCheckBox = new JCheckBox( "Activate Article Information Output"); statsOutputCheckBox.setBounds(10, 80, 250, 25); statsOutputCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { boolean flag = !controller.isStatsOutputEnabled(); controller.setEnableStatsOutput(flag); } }); this.add(statsOutputCheckBox); }
protected void layoutExtraComponents(Container cont) { Dimension dim = checkBox.getPreferredSize(); int posX = x + CONTROL_BUTTON_SPACE; int posY = y + ((getUpdatedInsets(cont).top - dim.height) / 2); checkBox.setBounds(posX, posY, dim.width, dim.height); }
@Override public void doLayout() { Dimension d_check = check == null ? new Dimension(0, 0) : check.getPreferredSize(); Dimension d_label = stringDisplayer == null ? new Dimension (0,0) : stringDisplayer.getPreferredSize(); int y_check = 0; if (d_check.height < d_label.height) { y_check = (d_label.height - d_check.height) / 2; } if (check != null) { check.setLocation(0, y_check); check.setBounds(0, y_check, d_check.width, d_check.height); if (checkBounds == null) checkBounds = check.getBounds(); } }
@Override public void paintComponent(Graphics g) { Dimension dCheck = check.getSize(); Dimension dLabel = stringDisplayer.getPreferredSize(); int yLabel = 0; if (dCheck.height >= dLabel.height) { yLabel = (dCheck.height - dLabel.height) / 2; } check.setBounds(0, 0, dCheck.width, dCheck.height); check.paint(g); int y = yLabel - 2; stringDisplayer.setBounds(dCheck.width, y, dLabel.width, getHeight() - 1); g.translate(dCheck.width, yLabel); stringDisplayer.paint(g); g.translate(-dCheck.width, -yLabel); }
public void layoutContainer(Container parent) { cb.setSize(cb.getPreferredSize()); cb.setLocation(2, 2); parent.getInsets(); list.setBounds(20, 0, parent.getWidth() - 20, parent.getHeight()); ListModel listModel = list.getModel(); for (int i = 0; i < listModel.getSize(); i++) { JCheckBox cb = item2CheckBoxMap.get(listModel.getElementAt(i)); if (cb != null) { Rectangle bounds = list.getCellBounds(i, i); cb.setBounds(0, bounds.y, bounds.height + 20, bounds.height); } } } }
@Override public void doLayout() { Dimension dCheck = check.getPreferredSize(); Dimension dLabel = stringDisplayer.getPreferredSize(); int yCheck = 0; if (dCheck.height < dLabel.height) { yCheck = (dLabel.height - dCheck.height) / 2; } check.setLocation(0, yCheck); check.setBounds(0, yCheck, dCheck.width, dCheck.height); if (checkBounds == null) { checkBounds = check.getBounds(); } }
public void layoutContainer(Container parent) { cb.setSize(cb.getPreferredSize()); cb.setLocation(2, 2); parent.getInsets(); list.setBounds(20, 0, parent.getWidth() - 20, parent.getHeight()); ListModel listModel = list.getModel(); for (int i = 0; i < listModel.getSize(); i++) { JCheckBox cb = item2CheckBoxMap.get(listModel.getElementAt(i)); if (cb != null) { Rectangle bounds = list.getCellBounds(i, i); cb.setBounds(0, bounds.y, bounds.height + 20, bounds.height); } } } }
public void layoutContainer(Container parent) { cb.setSize(cb.getPreferredSize()); cb.setLocation(2, 2); parent.getInsets(); list.setBounds(20, 0, parent.getWidth() - 20, parent.getHeight()); ListModel listModel = list.getModel(); for (int i = 0; i < listModel.getSize(); i++) { JCheckBox cb = item2CheckBoxMap.get(listModel.getElementAt(i)); if (cb != null) { Rectangle bounds = list.getCellBounds(i, i); cb.setBounds(0, bounds.y, bounds.height + 20, bounds.height); } } } }
@Override public void doLayout() { Dimension dCheck = check.getPreferredSize(); Dimension dLabel = label.getPreferredSize(); int yCheck = 0; int yLabel = 0; if (dCheck.height < dLabel.height) yCheck = (dLabel.height - dCheck.height) / 2; else yLabel = (dCheck.height - dLabel.height) / 2; check.setLocation(0, yCheck); check.setBounds(0, yCheck, dCheck.width, dCheck.height); label.setLocation(dCheck.width, yLabel); label.setBounds(dCheck.width, yLabel, dLabel.width, dLabel.height); }
public void doLayout() { Dimension d_check = check.getPreferredSize(); Dimension d_label = label.getPreferredSize(); int y_check = 0; int y_label = 0; if (d_check.height < d_label.height) { y_check = (d_label.height - d_check.height)/2; } else { y_label = (d_check.height - d_label.height)/2; } check.setLocation(0,y_check); check.setBounds(0,y_check,d_check.width,d_check.height); label.setLocation(d_check.width,y_label); label.setBounds(d_check.width,y_label,d_label.width,d_label.height); }
public void doLayout() { Dimension dCheck = checkBox.getPreferredSize(); Dimension dLabel = treeLabel.getPreferredSize(); int yCheck = 0; int yLabel = 0; if (dCheck.height < dLabel.height) { yCheck = (dLabel.height - dCheck.height) / 2; } else { yLabel = (dCheck.height - dLabel.height) / 2; } checkBox.setLocation(0, yCheck); checkBox.setBounds(0, yCheck, dCheck.width, dCheck.height); treeLabel.setLocation(dCheck.width, yLabel); treeLabel.setBounds(dCheck.width, yLabel, dLabel.width, dLabel.height); }
public void doLayout() { Dimension d_check = check.getPreferredSize(); Dimension d_label = label.getPreferredSize(); int y_check = 0; int y_label = 0; if (d_check.height < d_label.height) { y_check = (d_label.height - d_check.height) / 2; } else { y_label = (d_check.height - d_label.height) / 2; } check.setLocation(0, y_check); check.setBounds(0, y_check, d_check.width, d_check.height); label.setLocation(d_check.width, y_label); label.setBounds(d_check.width, y_label, d_label.width, d_label.height); }