Java Code Examples for javax.swing.JCheckBox

The following are top voted examples for showing how to use javax.swing.JCheckBox. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: myster   File: MessageManager.java   Source Code and License 8 votes vote down vote up
public MessagePreferencesPanel() {
    setLayout(null);

    refuseMessages = new JCheckBox("Refuse Messages");
    refuseMessages.setSize(150, 25);
    refuseMessages.setLocation(10, 25);
    refuseMessages.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            updateEnabled();
        }
    });
    add(refuseMessages);

    denyMessageLabel = new JLabel("Refusal Message:");
    denyMessageLabel.setSize(150, 25);
    denyMessageLabel.setLocation(20, 50);
    add(denyMessageLabel);

    denyMessageText = new JTextField(REFUSAL_MESSAGE_DEFAULT);
    denyMessageText.setSize(400, 25);
    denyMessageText.setLocation(25, 75);
    add(denyMessageText);

    setSize(STD_XSIZE, STD_YSIZE);
}
 
Example 2
Project: incubator-netbeans   File: CodeTemplatesOperator.java   Source Code and License 8 votes vote down vote up
public CodeTemplatesOperator setContext(Set<String> set) {
    JTabbedPaneOperator tabbedPane = getTabbedPane();
    tabbedPane.selectPage("Contexts");
    ContainerOperator<JEditorPane> selectedComponent = new ContainerOperator<>((Container)tabbedPane.getSelectedComponent());
    JListOperator list = new JListOperator(selectedComponent);
    for (int i = 0; i < list.getModel().getSize(); i++) {
        JCheckBox checkBox = (JCheckBox) list.getRenderedComponent(i);
        String contextName = checkBox.getText();
        list.scrollToItem(i);
        if(!checkBox.isSelected() && set.contains(contextName)) {
            list.selectItem(i);
        } else if(checkBox.isSelected() && !set.contains(contextName)) {
            list.selectItem(i);
        }            
    }   
    return this;
    
}
 
Example 3
Project: LivroJavaComoProgramar10Edicao   File: CheckBoxFrame.java   Source Code and License 7 votes vote down vote up
public CheckBoxFrame()
{
   super("JCheckBox Test");
   setLayout(new FlowLayout());

   // set up JTextField and set its font
   textField = new JTextField("Watch the font style change", 20);
   textField.setFont(new Font("Serif", Font.PLAIN, 14));
   add(textField); // add textField to JFrame

   boldJCheckBox = new JCheckBox("Bold"); 
   italicJCheckBox = new JCheckBox("Italic"); 
   add(boldJCheckBox); // add bold checkbox to JFrame
   add(italicJCheckBox); // add italic checkbox to JFrame

   // register listeners for JCheckBoxes
   CheckBoxHandler handler = new CheckBoxHandler();
   boldJCheckBox.addItemListener(handler);
   italicJCheckBox.addItemListener(handler);
}
 
Example 4
Project: Equella   File: FilteringTab.java   Source Code and License 6 votes vote down vote up
@Override
public void setup(ChangeDetector changeDetector)
{
	showResults = new JCheckBox(getString("filteringtab.display"), true); //$NON-NLS-1$
	filter = new SearchSetFilter(cache, clientService);

	final int[] rows = {TableLayout.PREFERRED, TableLayout.FILL,};
	final int[] cols = {TableLayout.FILL,};

	setLayout(new TableLayout(rows, cols));

	add(showResults, new Rectangle(0, 0, 1, 1));
	add(filter, new Rectangle(0, 1, 1, 1));

	changeDetector.watch(showResults);
	changeDetector.watch(filter);
}
 
Example 5
Project: TwitchBot   File: MainView.java   Source Code and License 6 votes vote down vote up
private void manageButtons() {
	this.joinChannel = new JButton("Join Channel");
	this.joinChannel.setPreferredSize(
			new Dimension(this.chatAreaDescription.getPreferredSize().width, this.joinChannel.getPreferredSize().height));
	this.joinChannel.setBorder(BorderFactory.createBevelBorder(1));

	this.leaveChannel = new JButton("Leave Channel");
	this.leaveChannel.setPreferredSize(
			new Dimension(this.chatAreaDescription.getPreferredSize().width, this.joinChannel.getPreferredSize().height));
	this.leaveChannel.setBorder(BorderFactory.createBevelBorder(1));

	this.actAsBot = new JCheckBox("React to !");
	this.actAsBot.setSelected(true);

	this.trollPaul = new JCheckBox("Copy Swaul");
	this.trollPaul.setSelected(false);

	this.trollMatti = new JCheckBox("Copy GeniusMatti");
	this.trollMatti.setSelected(false);

	this.logToFile = new JCheckBox("Log To File");
	this.logToFile.setSelected(true);

}
 
Example 6
Project: incubator-netbeans   File: ScopeOptionsController.java   Source Code and License 6 votes vote down vote up
private void init() {
    btnTestFileNamePattern = new JButton();
    chkFileNameRegex = new JCheckBox();
    chkFileNameRegex.setToolTipText(UiUtils.getText(
            "BasicSearchForm.chkFileNameRegex.tooltip"));           //NOI18N

    if (!replacing) {
        chkArchives = new JCheckBox();
        chkGenerated = new JCheckBox();
    }
    chkUseIgnoreList = new JCheckBox();
    btnEditIgnoreList = new JButton();
    checkBoxListener = new CheckBoxListener();

    component.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
    setMnemonics();
    initIgnoreListControlComponents();
    initScopeOptionsRow(replacing);
    initInteraction();
}
 
Example 7
Project: VisualGraphviz   File: MainFrame.java   Source Code and License 6 votes vote down vote up
private void addCheckBox() {
    /* isDirected */

    directed = new JCheckBox("isDirected");
    directed.setBounds(635, 17, 125, 20);
    directed.setFont(checkBoxFont);
    directed.setMargin(DEFAULT_INSETS);

    /* hasWight */

    weight = new JCheckBox("hasWeight");
    weight.setBounds(530, 17, 100, 20);
    weight.setFont(checkBoxFont);
    weight.setMargin(DEFAULT_INSETS);
}
 
Example 8
Project: GIFKR   File: PreviewStatusPanel.java   Source Code and License 6 votes vote down vote up
private void initializeComponents() {
	qualitySlider = new JSlider(10, 100, 50) {
		private static final long serialVersionUID = -3633632766184431178L;

		@Override
		public Dimension getPreferredSize() {
			return new Dimension(super.getPreferredSize().width/2, new JLabel(" ").getPreferredSize().height);
		}
	};
	qualitySlider.addChangeListener(ce -> r.refresh());
	
	qualitySlider.setOpaque(false);
	statusLabel = new JLabel();
	skipFrames = new JCheckBox("Skip frames", false);
	skipFrames.setOpaque(false);
}
 
Example 9
Project: incubator-netbeans   File: EditorPanelOperator.java   Source Code and License 6 votes vote down vote up
protected JPanel getOpenedPanel(EditorOperator editorOperator) {
    for (int i = 0; i < 10; i++) {
        this.panel =  findPanel((Container) editorOperator.getSource());
        if(panel!=null) break;
        new EventTool().waitNoEvent(200);
    }
    if(panel==null) return null;
    for (Component c : panel.getComponents()) {
        if (c instanceof JCheckBox) {
            checkBoxesInPanel.add((JCheckBox)c);
        } else if(c instanceof JButton) {
            buttons.add((JButton)c);
        }
    }      
    return panel;
}
 
Example 10
Project: marathonv5   File: RToggleButtonTest.java   Source Code and License 6 votes vote down vote up
public void selectCheckBoxNotSelected() throws InterruptedException {
    final LoggingRecorder lr = new LoggingRecorder();
    siw(new Runnable() {
        @Override public void run() {
            List<Component> comps = ComponentUtils.findComponents(JCheckBox.class, frame);
            JCheckBox checkBox = (JCheckBox) comps.get(3);
            RToggleButton rButton = new RToggleButton(checkBox, null, null, lr);
            checkBox.setSelected(false);
            rButton.mouseEntered(null);
            checkBox.setSelected(true);
            rButton.mouseClicked(null);
        }
    });
    Call call = lr.getCall();
    AssertJUnit.assertEquals("select", call.getFunction());
    AssertJUnit.assertEquals("true", call.getState());
}
 
Example 11
Project: KernelHive   File: ResourceMonitorPanel.java   Source Code and License 6 votes vote down vote up
/**
 *
 */
public ResourceMonitorPanel() {
	setLayout(new BorderLayout(0, 0));

	picturePanel = new JPanel();
	picturePanel.setLayout(new BoxLayout(picturePanel, BoxLayout.PAGE_AXIS));

	JScrollPane scroll = new JScrollPane(picturePanel);
	add(scroll);

	final JPanel buttonPanel = new JPanel();
	add(buttonPanel, BorderLayout.SOUTH);

	btnRefresh = new JButton("Refresh");
	buttonPanel.add(btnRefresh);

	autoRefreshCheckbox = new JCheckBox("Auto-refresh", true);
	buttonPanel.add(autoRefreshCheckbox);
}
 
Example 12
Project: xdman   File: XDMMainWindow.java   Source Code and License 6 votes vote down vote up
int getDupAction(String url) {
	JTextField txt = new JTextField(url, 30);
	String lbl = StringResource.getString("DUP_TXT");
	JComboBox choice = new JComboBox(new String[] { StringResource.getString("DUP_OP1"),
			StringResource.getString("DUP_OP2"), StringResource.getString("DUP_OP3") });
	JCheckBox chk = new JCheckBox(StringResource.getString("DUP_CHK"));
	int ret = JOptionPane.showOptionDialog(null, new Object[] { txt, lbl, choice, chk },
			StringResource.getString("DUP_TITLE"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,
			null, null);
	if (ret == JOptionPane.OK_OPTION) {
		int index = choice.getSelectedIndex();
		if (chk.isSelected()) {
			config.duplicateLinkAction = index;
		}
		return index;
	}
	return -1;
}
 
Example 13
Project: PTEAssistant   File: UserTableHeaderCellRenderer.java   Source Code and License 6 votes vote down vote up
public UserTableHeaderCellRenderer(JTable table) {
    this.tableModel = (UserTableModel) table.getModel();
    this.tableHeader = table.getTableHeader();
    selectBox = new JCheckBox(tableModel.getColumnName(0));
    selectBox.setSelected(false);
    tableHeader.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() > 0) {
                int selectColumn = tableHeader.columnAtPoint(e.getPoint());
                if (selectColumn == 0) {
                    boolean value = !selectBox.isSelected();
                    selectBox.setSelected(value);
                    tableModel.selectAll(value);
                    tableHeader.repaint();
                }
            }
        }
    });
}
 
Example 14
Project: projetomcdonalds   File: ControlerAlteracaoLanche.java   Source Code and License 6 votes vote down vote up
public ControlerAlteracaoLanche(AlteracaoLanche alteracaoLanche, Lanche lanche, Vendas tela) {
    this.alteracaoLanche = alteracaoLanche;
    this.lanche = lanche;
    this.telaVenda = tela;

    this.alteracaoLanche.getBtn_Cancelar().addActionListener(this);
    this.alteracaoLanche.getBtn_Finalizar().addActionListener(this);
    for (JCheckBox botao : this.alteracaoLanche.getBotoes()) {
        botao.addActionListener(this);
    }

    getDados();
    iniciaCheckBox();
    marcarCheck();

    this.alteracaoLanche.setVisible(true);
    this.alteracaoLanche.toFront();
    this.alteracaoLanche.setLocationRelativeTo(this.telaVenda);
    this.alteracaoLanche.setVisible(true);
}
 
Example 15
Project: JDigitalSimulator   File: Application.java   Source Code and License 6 votes vote down vote up
private JPanel createTitlePanel() {
	JPanel title = new JPanel(new BorderLayout());
	title.add(Guitilities.createGradientTitle(getTranslation("components.title")), BorderLayout.NORTH);

	JPanel interact = new JPanel();
	interact.setBackground(UIManager.getColor(Guitilities.SUB_PANEL_BACKGROUND));
	interact.setLayout(new BoxLayout(interact, BoxLayout.X_AXIS));
	interact.setBorder(new CompoundBorder(Guitilities.CHISEL_BORDER, new EmptyBorder(12, 8, 12, 8)));
	final JCheckBox checkImages = new JCheckBox(getTranslation("group.images"), true);
	checkImages.setBackground(UIManager.getColor(Guitilities.SUB_PANEL_BACKGROUND));
	checkImages.addActionListener(new ActionListener() {
		@Override public void actionPerformed(ActionEvent event) {
			for(ComponentButton button:componentButtons)
				button.setIconVisible(checkImages.isSelected());
			for(CollapsiblePanel panel:collapsiblePanels)
				panel.setExpanded(false);
		}
	});
	interact.add(checkImages);
	title.add(interact, BorderLayout.CENTER);
	return title;
}
 
Example 16
Project: Tarski   File: SimpleGUI.java   Source Code and License 6 votes vote down vote up
/** This method performs Edit->Find. */
private Runner doFind() {
    if (wrap) return wrapMe();
    JTextField x = OurUtil.textfield(lastFind,30);
    x.selectAll();
    JCheckBox c = new JCheckBox("Case Sensitive?",lastFindCaseSensitive);
    c.setMnemonic('c');
    JCheckBox b = new JCheckBox("Search Backward?",!lastFindForward);
    b.setMnemonic('b');
    if (!OurDialog.getInput("Find", "Text:", x, " ", c, b)) return null;
    if (x.getText().length() == 0) return null;
    lastFind = x.getText();
    lastFindCaseSensitive = c.getModel().isSelected();
    lastFindForward = !b.getModel().isSelected();
    doFindNext();
    return null;
}
 
Example 17
Project: jdk8u-jdk   File: Test7024235.java   Source Code and License 6 votes vote down vote up
public void run() {
    if (this.pane == null) {
        this.pane = new JTabbedPane();
        this.pane.addTab("1", new Container());
        this.pane.addTab("2", new JButton());
        this.pane.addTab("3", new JCheckBox());

        JFrame frame = new JFrame();
        frame.add(BorderLayout.WEST, this.pane);
        frame.pack();
        frame.setVisible(true);

        test("first");
    }
    else {
        test("second");
        if (this.passed || AUTO) { // do not close a frame for manual review
            SwingUtilities.getWindowAncestor(this.pane).dispose();
        }
        this.pane = null;
    }
}
 
Example 18
Project: VASSAL-src   File: ReportState.java   Source Code and License 6 votes vote down vote up
public Ed(ReportState piece) {

      box = new JPanel();
      box.setLayout(new BoxLayout(box, BoxLayout.Y_AXIS));
      descInput = new StringConfigurer(null, "Description:  ", piece.description);
      box.add(descInput.getControls());
      keys = new NamedKeyStrokeArrayConfigurer(null, "Report on these keystrokes:  ", piece.keys);
      box.add(keys.getControls());
      cycle = new JCheckBox("Cycle through different messages?");
      box.add(cycle);
      format = new PlayerIdFormattedStringConfigurer(null, "Report format:  ", new String[]{COMMAND_NAME,
                                                                                         OLD_UNIT_NAME,
                                                                                         NEW_UNIT_NAME,
                                                                                         MAP_NAME,
                                                                                         OLD_MAP_NAME,
                                                                                         LOCATION_NAME,
                                                                                         OLD_LOCATION_NAME});
      format.setValue(piece.reportFormat);
      box.add(format.getControls());
      cycleFormat = new StringArrayConfigurer(null, "Message formats", piece.cycleReportFormat);
      box.add(cycleFormat.getControls());
      cycleDownKeys = new NamedKeyStrokeArrayConfigurer(null, "Report previous message on these keystrokes:  ", piece.cycleDownKeys);
      box.add(cycleDownKeys.getControls());
      ItemListener l = new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          format.getControls().setVisible(!cycle.isSelected());
          cycleFormat.getControls().setVisible(cycle.isSelected());
          cycleDownKeys.getControls().setVisible(cycle.isSelected());
          Window w = SwingUtilities.getWindowAncestor(box);
          if (w != null) {
            w.pack();
          }
        }
      };
      l.itemStateChanged(null);
      cycle.addItemListener(l);
      cycle.setSelected(piece.cycleReportFormat.length > 0);
    }
 
Example 19
Project: A-Pathfinding-Visualization   File: ControlHandler.java   Source Code and License 5 votes vote down vote up
public JCheckBox getC(String t) {
	for(int i = 0; i < checks.size(); i++) {
		if(checks.get(i).getName().equals(t)) {
			return checks.get(i);
		}
	}
	return null;
}
 
Example 20
Project: openjdk-jdk10   File: Test4520754.java   Source Code and License 5 votes vote down vote up
public static void main(String[] args) {
    // ensure that 4168475 does not regress
    test4168475(Component.class);
    // AWT classes (com.sun.beans.infos.ComponentBeanInfo)
    test(null, Button.class, Component.class, List.class, Menu.class, Panel.class);
    // Swing classes (dt.jar)
    test(null, JApplet.class, JButton.class, JCheckBox.class);
    // user defined classes
    test(Boolean.TRUE, Wombat.class, Foo.class, FooBar.class);
}
 
Example 21
Project: gchisto   File: GUIUtilities.java   Source Code and License 5 votes vote down vote up
/**
 * It creates a new check box for inclusion in a table and sets 
 * its "is selected" attribute to the given value.
 * 
 * @param selected It determines whether the newly-created check box
 * will be selected or not.
 * @return A new check box for inclusion in a table.
 */
static public JCheckBox createJCheckBoxForTable(boolean selected) {
    JCheckBox checkBox = new JCheckBox();
    checkBox.setOpaque(true);
    checkBox.setHorizontalAlignment(SwingConstants.CENTER);
    checkBox.setForeground(TABLE_COMPONENT_FG_COLOR);
    checkBox.setBackground(TABLE_COMPONENT_BG_COLOR);
    checkBox.setSelected(selected);
    return checkBox;
}
 
Example 22
Project: Equella   File: AttachmentsSectionConfig.java   Source Code and License 5 votes vote down vote up
@Override
public void setup()
{
	showFull = new JCheckBox(s("showfullscreen"));
	showFullNewWindow = new JCheckBox(s("showfullscreen.newwindow"));
	modeStructured = new JRadioButton(s("displaymode.structured.title"));
	modeThumbnail = new JRadioButton(s("displaymode.thumbnail.title"));
	metadataTarget = new MultiTargetChooser(schemaModel, "");

	ButtonGroup bg = new ButtonGroup();
	bg.add(modeStructured);
	bg.add(modeThumbnail);

	changeDetector = new ChangeDetector();
	changeDetector.watch(showFull);
	changeDetector.watch(showFullNewWindow);
	changeDetector.watch(modeStructured);
	changeDetector.watch(modeThumbnail);
	changeDetector.watch(metadataTarget);

	setLayout(new MigLayout("wrap", "[]"));

	super.setup();

	add(new JLabel(s("fullscreen")), "gaptop 2u");
	add(showFull, "gap 2i");
	add(showFullNewWindow, "gap 2i");

	add(new JLabel(s("displaymode")), "gaptop 2u");

	add(modeStructured, "gap i*2");
	add(new JLabel("<html>" + s("displaymode.structured.description")), "gap i*4");

	add(modeThumbnail, "gap i*2");
	add(new JLabel("<html>" + s("displaymode.thumbnail.description")), "gap i*4");

	add(new JLabel(s("restrict")), "gaptop 2u, grow");
	add(new JLabel("<html>" + s("restrict.help")), "gap 2i");
	add(metadataTarget, "grow, gap 2i");
}
 
Example 23
Project: Equella   File: SearchSetInheritance.java   Source Code and License 5 votes vote down vote up
public SearchSetInheritance(final EntityCache cache, final ClientService clientService)
{
	final JLabel schemasLabel = new JLabel(
		getString("searchset.searchsetinheritance.inheritschemas")); //$NON-NLS-1$
	final JLabel itemDefsLabel = new JLabel(
		getString("searchset.searchsetinheritance.inheritcollections")); //$NON-NLS-1$

	inheritFreetext = new JCheckBox(
		getString("searchset.searchsetinheritance.inheritfreetext")); //$NON-NLS-1$
	schemasModel = new InheritedTableModel<Schema, SchemaScript>(cache.getSchemaMap(), SchemaScript.class,
		getString("searchset.searchsetinheritance.schema")); //$NON-NLS-1$
	itemDefsModel = new InheritedTableModel<ItemDefinition, ItemDefinitionScript>(cache.getItemDefinitionMap(),
		ItemDefinitionScript.class,
		getString("searchset.searchsetinheritance.collection")); //$NON-NLS-1$

	final JTable schemasTable = generateTable(schemasModel, clientService);
	final JTable itemDefTable = generateTable(itemDefsModel, clientService);

	final int height1 = inheritFreetext.getPreferredSize().height;
	final int height2 = schemasLabel.getPreferredSize().height;

	final int[] rows = {height1, height2, TableLayout.FILL, height2, TableLayout.FILL,};
	final int[] cols = {TableLayout.FILL,};

	setLayout(new TableLayout(rows, cols));

	add(inheritFreetext, new Rectangle(0, 0, 1, 1));

	add(schemasLabel, new Rectangle(0, 1, 1, 1));
	add(new JScrollPane(schemasTable), new Rectangle(0, 2, 1, 1));

	add(itemDefsLabel, new Rectangle(0, 3, 1, 1));
	add(new JScrollPane(itemDefTable), new Rectangle(0, 4, 1, 1));

	changeDetector = new ChangeDetector();
	changeDetector.watch(inheritFreetext);
	changeDetector.watch(schemasModel);
	changeDetector.watch(itemDefsModel);
}
 
Example 24
Project: sumo   File: ActionDialog.java   Source Code and License 5 votes vote down vote up
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    this.setVisible(false);
    try {
        //String[] args = new String[components.size() ];
        this.actionArgs=new HashMap<>();
        int i = 0;
        for (JComponent c : components.values()) {
            if (c instanceof JTextField) {
                //args[i++]= ((JTextField) c).getText();
                actionArgs.put(((JTextField) c).getName(), ((JTextField) c).getText());
            } else if (c instanceof JComboBox) {
                //args[i++] = ((JComboBox) c).getSelectedItem() + "";
                actionArgs.put(((JComboBox) c).getName(),  ((JComboBox) c).getSelectedItem() + "");
            }
            else if (c instanceof JCheckBox) {
               // args[i++] = ((JCheckBox) c).isSelected() + "";
                actionArgs.put(((JCheckBox) c).getName(), ((JCheckBox) c).isSelected() + "");
            }
            /* else if (c instanceof DateControl) {
                args[i++] = new Timestamp(((DateControl) c).getDate().getTime()).toString();
            }*/
        }
        ok=true;
    } catch (Exception ex) {
    	logger.error(ex.getMessage(),ex);
    	ok=false;
    }
}
 
Example 25
Project: BaseClient   File: EffectUtil.java   Source Code and License 5 votes vote down vote up
/**
 * Prompts the user for boolean value
 * 
 * @param name The name of the dialog to show
 * @param currentValue The current value to be displayed
 * @param description The help text to provide
 * @return The value selected by the user
 */
static public Value booleanValue (String name, final boolean currentValue, final String description) {
	return new DefaultValue(name, String.valueOf(currentValue)) {
		public void showDialog () {
			JCheckBox checkBox = new JCheckBox();
			checkBox.setSelected(currentValue);
			if (showValueDialog(checkBox, description)) value = String.valueOf(checkBox.isSelected());
		}

		public Object getObject () {
			return Boolean.valueOf(value);
		}
	};
}
 
Example 26
Project: Equella   File: InternalDataSourceChoice.java   Source Code and License 5 votes vote down vote up
public InternalDataSourceChoice()
{
	super(new MigLayout("wrap 1"));

	allowNewTerms = new JCheckBox(getString("internal.allownewterms"));

	add(new JLabel("<html>" + getString("internal.choicedescription")));
	add(allowNewTerms);

	changeDetector.watch(allowNewTerms);
}
 
Example 27
Project: gate-core   File: CheckBoxTableCellRenderer.java   Source Code and License 5 votes vote down vote up
public CheckBoxTableCellRenderer() {
  super();

  // centre the checkbox within the cell
  setHorizontalAlignment(JCheckBox.CENTER);

  // make sure we always paint the cell border
  setBorderPainted(true);

  // make sure we always paint the background
  setOpaque(true);
}
 
Example 28
Project: incubator-netbeans   File: DataViewUI.java   Source Code and License 5 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
    JCheckBox source = (JCheckBox) e.getSource();
    int index = Integer.parseInt(e.getActionCommand());
    Set<Integer> currentVisibleColumns = dataPanel.getVisibleColumns();
    if (source.isSelected()) {
        currentVisibleColumns.add(index);
    } else {
        currentVisibleColumns.remove(index);
    }
    dataPanel.setVisibleColumns(currentVisibleColumns);
}
 
Example 29
Project: jaer   File: ControlPanel.java   Source Code and License 5 votes vote down vote up
void addTip(Controllable f, JCheckBox label) {
    String s = f.getPropertyTooltip(label.getText());
    if (s == null) {
        return;
    }
    label.setToolTipText(s);
    label.setForeground(Color.BLUE);
}
 
Example 30
Project: AgentWorkbench   File: TableCellRenderer4CheckBox.java   Source Code and License 5 votes vote down vote up
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
	
	JCheckBox checkBox = new JCheckBox();
	checkBox.setSelected((Boolean) value);
	checkBox.setHorizontalAlignment(SwingConstants.CENTER);
	checkBox.setOpaque(true);
	GraphGlobals.Colors.setTableCellRendererColors(checkBox, row, isSelected);
	return checkBox;
}
 
Example 31
Project: incubator-netbeans   File: DefaultFoldingOptions.java   Source Code and License 5 votes vote down vote up
private void updateChecker(String prefKey, JCheckBox cb, FoldType ft) {
    if (lastChangedCB == cb) {
        // ignore
        lastChangedCB = null;
        return;
    }
    boolean val = isCollapseEnabled(ft);
    ignoreStateChange = true;
    LOG.log(Level.FINE, "Updating checker: " + prefKey + ", setSelected " + val); // NOI18N
    cb.setSelected(val);
    ignoreStateChange = false;
}
 
Example 32
Project: Progetto-C   File: EmitterList.java   Source Code and License 5 votes vote down vote up
/**
 * @see javax.swing.DefaultListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
 */
public Component getListCellRendererComponent(JList list, final Object value, int index, boolean isSelected, boolean cellHasFocus) {
	JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected,
			cellHasFocus);
	
	final JCheckBox box = new JCheckBox(label.getText());
	box.setBackground(label.getBackground());
	
	box.setSelected(((ConfigurableEmitter) value).isEnabled());
	checks.put(value, box);
	
	return box;
}
 
Example 33
Project: Hollow-Knight-SaveManager   File: CharmPanel.java   Source Code and License 5 votes vote down vote up
public static List<CharmPanel> createCharmPanels(JsonObject playerData, Notches notches, JCheckBox autoCalc, JCheckBox overcharmed){
	List<CharmPanel> out = new ArrayList<CharmPanel>(); 
	for( int i = 0; i < 40; i++){
		CharmPanel charm = new CharmPanel(i, charmNames[i], playerData, notches, autoCalc, overcharmed);
		out.add(charm);
	}
	Collections.sort(out);
	return out;
}
 
Example 34
Project: Equella   File: MultiEditor.java   Source Code and License 5 votes vote down vote up
private JComponent createDetails()
{
	JLabel titleLabel = new JLabel(CurrentLocale.get("wizard.controls.title")); //$NON-NLS-1$
	JLabel descriptionLabel = new JLabel(CurrentLocale.get("wizard.controls.description")); //$NON-NLS-1$

	title = new I18nTextField(BundleCache.getLanguages());
	description = new I18nTextField(BundleCache.getLanguages());
	mandatory = new JCheckBox(CurrentLocale.get("wizard.controls.mandatory")); //$NON-NLS-1$

	final int height1 = title.getPreferredSize().height;
	final int width1 = descriptionLabel.getPreferredSize().width;

	final int[] rows = {height1, height1, height1,};
	final int[] cols = {width1, TableLayout.FILL, TableLayout.DOUBLE_FILL,};

	JPanel all = new JPanel(new TableLayout(rows, cols, 5, 5));

	all.add(titleLabel, new Rectangle(0, 0, 1, 1));
	all.add(title, new Rectangle(1, 0, 2, 1));

	all.add(descriptionLabel, new Rectangle(0, 1, 1, 1));
	all.add(description, new Rectangle(1, 1, 2, 1));

	all.add(mandatory, new Rectangle(0, 2, 2, 1));

	return all;
}
 
Example 35
Project: incubator-netbeans   File: DefaultOutlineCellRenderer.java   Source Code and License 5 votes vote down vote up
final JCheckBox createCheckBox() {
    JCheckBox cb = new JCheckBox();
    cb.setSize(cb.getPreferredSize());
    cb.setBorderPainted(false);
    cb.setOpaque(false);
    return cb;
}
 
Example 36
Project: jmeter-prometheus-plugin   File: PrometheusListenerGui.java   Source Code and License 5 votes vote down vote up
protected JPanel createLabelsPanel() {
	HorizontalPanel panel = new HorizontalPanel();
	panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"Labels"));
	
	this.codeCheckBox = new JCheckBox("Code");
	panel.add(this.codeCheckBox);
	
	this.labelsCheckBox = new JCheckBox("Jmeter Labels");
	panel.add(this.labelsCheckBox);
	
	this.successCheckBox = new JCheckBox("Success");
	panel.add(this.successCheckBox);
	
	return panel;
}
 
Example 37
Project: appinventor-extensions   File: AIMerger.java   Source Code and License 5 votes vote down vote up
private static JCheckBox[] getScreenCheckBoxes(AIProject project, boolean isMainProject) {
  List<AIScreen> tempScreensList = project.getScreensList();
  JCheckBox[] screenCheckBoxLabels = new JCheckBox[1 + tempScreensList.size()];
  screenCheckBoxLabels[0] = new JCheckBox("Check All");
  for (int i = 1; i <= tempScreensList.size(); i++) {
    String tempScreenName = tempScreensList.get(i - 1).getName();
    if (tempScreenName.equals("Screen1") && isMainProject) {
      screenCheckBoxLabels[i] = new JCheckBox(tempScreenName, true);
    } else {
      screenCheckBoxLabels[i] = new JCheckBox(tempScreenName);
    }
  }
  return screenCheckBoxLabels;
}
 
Example 38
Project: geomapapp   File: CustomDB.java   Source Code and License 5 votes vote down vote up
protected Component createThumbsCheckbox() {
	thumbsB = new JCheckBox("<html>Image Viewer</html>",true);
	thumbsB.setSize(45, 45);
	thumbsB.addActionListener(this);
	thumbsB.setActionCommand("thumb");
	thumbsB.setEnabled(false);
	return thumbsB;
}
 
Example 39
Project: incubator-netbeans   File: NodeTableModel.java   Source Code and License 5 votes vote down vote up
void makeAccessibleCheckBox(JCheckBox box, Property p) {
    box.getAccessibleContext().setAccessibleName(p.getDisplayName());
    box.getAccessibleContext().setAccessibleDescription(p.getShortDescription());

    Object mnemonicChar = p.getValue(ATTR_MNEMONIC_CHAR);

    if ((null != mnemonicChar) && (mnemonicChar.toString().length() > 0)) {
        box.setMnemonic(mnemonicChar.toString().charAt(0));
    }
}
 
Example 40
Project: jdk8u-jdk   File: bug8032667.java   Source Code and License 5 votes vote down vote up
static JCheckBox getCheckBox(String text, boolean selected) {
    JCheckBox checkBox = new JCheckBox(text);
    checkBox.setSelected(selected);
    checkBox.setSize(new Dimension(width, height));
    return checkBox;
}
 
Example 41
Project: BachSys   File: TelaPrincipal.java   Source Code and License 5 votes vote down vote up
private void adicionarPainelListaMusica() {
        painelListaMusica = new Painel(600, 550);
        adicionarComponente(painelListaMusica, GridBagConstraints.CENTER, GridBagConstraints.BOTH, 0, 1, 1, 2);
//        painelListaMusica.setBackground(Color.red);
        
        
       
        criaTabelaMusicas(musicas, false);

        boxMusicasUsuario = new JCheckBox("Ver apenas minhas músicas");
        painelListaMusica.adicionarComponente(boxMusicasUsuario, GridBagConstraints.WEST,
                                            GridBagConstraints.NONE, 0, 2, 1, 1, 0.1, 0.1);
        adicionarBarraBusca();
    }
 
Example 42
Project: jdk8u-jdk   File: Test4129681.java   Source Code and License 5 votes vote down vote up
@Override
public void init() {
    JCheckBox check = new JCheckBox("disable");
    check.addItemListener(this);

    this.label = new JLabel("message");
    this.label.setBorder(BorderFactory.createTitledBorder("label"));
    this.label.setEnabled(!check.isSelected());

    add(BorderLayout.NORTH, check);
    add(BorderLayout.CENTER, this.label);
}
 
Example 43
Project: rapidminer   File: DefaultRMCellEditor.java   Source Code and License 5 votes vote down vote up
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
	Component c = super.getTableCellEditorComponent(table, value, isSelected, row, column);
	if (c instanceof JComponent && !(c instanceof JCheckBox)) {
		JComponent component = (JComponent) c;
		if (isSelected) {
			component.setBorder(FocusedComponentBorder.getInstance());
		} else {
			component.setBorder(null);
		}
	}
	return c;
}
 
Example 44
Project: PMDe   File: ExclusivePokemonEditor.java   Source Code and License 5 votes vote down vote up
@Override
protected void initProperties() {
    setTitle("Exclusive Pokémon editor");
    
    // Initialize the components
    
    lblPokemon = new JLabel("Pokémon");
    cmoPokemon = new JComboBox();
    cmoPokemon.setModel(new DefaultComboBoxModel(Lists.pokemon.toArray()));
    chkRed = new JCheckBox("Found in Red Rescue Team");
    chkBlue = new JCheckBox("Found in Blue Rescue Team");
    
    // Add the components to the property panel
    properties.addCaption("Exclusive Pokémon settings");
    properties.addLabeledComponent(lblPokemon, cmoPokemon);
    properties.addComponent(chkRed);
    properties.addComponent(chkBlue);
    properties.addTerminator();
    
    // Create additional toolbar components
    btnClear = new JButton("Clear entries");
    btnClear.addActionListener((java.awt.event.ActionEvent evt) -> {
        for (int i = 0 ; i < RomFile.current.exclusivePokemon.size() ; i++) {
            ExclusivePokemon exc = RomFile.current.exclusivePokemon.get(i);
            exc.species = 0;
            exc.red = false;
            exc.blue = false;
            model.set(i, exc.toString());
        }
    });
    toolbar.add(btnClear);
}
 
Example 45
Project: routerapp   File: GeneralSettings.java   Source Code and License 5 votes vote down vote up
/**
 * Creates an instance of this class.
 */
private GeneralSettings () {
	setTitle("General Configuration");
	setBounds(50,50,320,320);

	centerPanel = new JPanel(new FlowLayout());
	JPanel southPanel  = new JPanel(new FlowLayout());
	
	aStarExecutionMeasureBox = new JCheckBox("AStar Execution Measure", TSProblemModel.ASTAR_DEFAULT_MEASURE_EXECUTION);
	gaExecutionMeasureBox = new JCheckBox("GA Execution Measure", TSProblemModel.GA_DEFAULT_MEASURE_EXECUTION);
	pfihExecutionMeasureBox = new JCheckBox("PFIH Execution Measure", VRProblemModel.PFIH_DEFAULT_MEASURE_EXECUTION);
	lsdExecutionMeasureBox = new JCheckBox("Local Search  Execution Measure", VRProblemModel.LSD_DEFAULT_MEASURE_EXECUTION);
	saExecutionMeasureBox = new JCheckBox("SA Execution Measure", VRProblemModel.SA_DEFAULT_MEASURE_EXECUTION);
	
	centerPanel.add(aStarExecutionMeasureBox);
	centerPanel.add(gaExecutionMeasureBox);
	centerPanel.add(pfihExecutionMeasureBox);
	centerPanel.add(lsdExecutionMeasureBox);
	centerPanel.add(saExecutionMeasureBox);
			
	// Add demands table in Center Panel		
	centerPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
	centerPanel.setBackground(Color.getColor("202,198,202"));
	
	// Create buttons and buttons panel
	JPanel buttonsPanel = new JPanel(new FlowLayout());
	buttonsPanel.add(new JButton(RESTORE_DEFAULT_ACTION));
	buttonsPanel.add(new JButton(OK_ACTION));
	buttonsPanel.add(new JButton(CANCEL_ACTION));

	// Add buttons panel in South Panel
	southPanel.add(buttonsPanel,BorderLayout.EAST);
	
	// Add panels in Main Panel
	this.getContentPane().setLayout(new BorderLayout());
	this.getContentPane().add(southPanel,BorderLayout.SOUTH);
	this.getContentPane().add(centerPanel,BorderLayout.CENTER);		
}
 
Example 46
Project: ants   File: MenuListener.java   Source Code and License 5 votes vote down vote up
public MenuListener(JFrame mainContainer, GuiEventListener listener, JTabbedPane tabbedPane,
		JList<String> firstListOfAnthills, JList<String> secondListOfAnthills, JList<String> thirdListOfAnthills,
		JList<String> replays, JButton buttonStart, JRadioButton radioQualification,
		JRadioButton radioTournamentSemiFinals, JScrollPane scrollPaneQualification,
		JScrollPane scrollPaneTournament, JCheckBox runInBackgroundCheckbox) {
	this.tabbedPane = tabbedPane;
	this.buttonStart = buttonStart;
	this.firstListOfAnthills = firstListOfAnthills;
	this.secondListOfAnthills = secondListOfAnthills;
	this.thirdListOfAnthills = thirdListOfAnthills;
	this.replays = replays;
	this.radioQualification = radioQualification;
	this.radioTournamentSemiFinals = radioTournamentSemiFinals;
	this.scrollPaneQualification = scrollPaneQualification;
	this.scrollPaneTournament = scrollPaneTournament;
	this.listener = listener;
	this.runInBackgroundCheckbox = runInBackgroundCheckbox;

	tabbedPane.addChangeListener(this);
	firstListOfAnthills.addListSelectionListener(this);
	secondListOfAnthills.addListSelectionListener(this);
	thirdListOfAnthills.addListSelectionListener(this);
	replays.addListSelectionListener(this);
	buttonStart.addActionListener(this);
	radioQualification.addActionListener(this);
	radioTournamentSemiFinals.addActionListener(this);
}
 
Example 47
Project: incubator-netbeans   File: MarkOccurencesPanel.java   Source Code and License 5 votes vote down vote up
private void addListeners() {
    ChangeListener cl = new CheckChangeListener();
    
    for( JCheckBox box : boxes ) {
        box.addChangeListener(cl);
    }
    
}
 
Example 48
Project: incubator-netbeans   File: MarkOccurencesPanel.java   Source Code and License 5 votes vote down vote up
private void fireChanged() {
    Preferences node = MarkOccurencesSettings.getCurrentNode();
    for (JCheckBox box : boxes) {
        if (node.getBoolean(box.getActionCommand(), DEFAULT_VALUE) != box.isSelected()) {
            changed = true;
            return;
        }
    }
    changed = false;
}
 
Example 49
Project: Equella   File: EmailSelectorControlEditor.java   Source Code and License 5 votes vote down vote up
private JComponent createDetailsSection()
{
	final JLabel titleLabel = new JLabel(CurrentLocale.get("wizard.controls.title")); //$NON-NLS-1$
	final JLabel descriptionLabel = new JLabel(CurrentLocale.get("wizard.controls.description")); //$NON-NLS-1$

	final Set<Locale> langs = BundleCache.getLanguages();
	title = new I18nTextField(langs);
	description = new I18nTextField(langs);
	mandatory = new JCheckBox(CurrentLocale.get("wizard.controls.mandatory")); //$NON-NLS-1$
	selectMultiple = new JCheckBox(getString("emailsel.selectmultiple")); //$NON-NLS-1$

	final int height1 = title.getPreferredSize().height;
	final int width1 = descriptionLabel.getPreferredSize().width;

	final int[] rows = {height1, height1, height1, height1};
	final int[] cols = {width1, TableLayout.FILL, TableLayout.DOUBLE_FILL};
	final JPanel all = new JPanel(new TableLayout(rows, cols));

	int row = 0;
	all.add(titleLabel, new Rectangle(0, row, 1, 1));
	all.add(title, new Rectangle(1, row++, 2, 1));

	all.add(descriptionLabel, new Rectangle(0, row, 1, 1));
	all.add(description, new Rectangle(1, row++, 2, 1));

	all.add(mandatory, new Rectangle(0, row++, 3, 1));

	all.add(selectMultiple, new Rectangle(0, row++, 3, 1));

	return all;
}
 
Example 50
Project: AgentWorkbench   File: DynTableCellRenderEditor.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the new value to the DynForm component.
 * @param displayComponent the current displayComponent
 */
private void setValueOfDynFormComponent(JComponent displayComponent) {
	JComponent dynFormComponent = this.dynType.getFieldDisplay();
	if (displayComponent instanceof JTextField) {
		((JTextField) dynFormComponent).setText(((JTextField) displayComponent).getText());
	} else if (displayComponent instanceof JCheckBox) {
		((JCheckBox)dynFormComponent).setSelected(((JCheckBox)displayComponent).isSelected());
	}
}
 
Example 51
Project: incubator-netbeans   File: GuiUtils.java   Source Code and License 5 votes vote down vote up
/**
 * Creates a specified set of checkboxes.
 * The checkboxes are specified by unique identifiers.
 * The identifiers are given by this class's constants <code>CHK_xxx</code>.
 * <p>
 * The array of strings passed as the argument may also contain
 * <code>null</code> items. In such a case, the resulting array
 * of check-boxes will contain <code>null</code>s on the corresponding
 * possitions.
 *
 * @param  ids  identifiers of the checkboxes to be created
 * @return  array of checkboxes corresponding to the array of identifiers
 *          passed as the argument
 */
public static JCheckBox[] createCheckBoxes(String[] ids) {
    JCheckBox[] chkBoxes = new JCheckBox[ids.length];
    
    if (chkBoxes.length == 0) {
        return chkBoxes;
    }
    
    ResourceBundle bundle = NbBundle.getBundle(GuiUtils.class);
    for (int i = 0; i < ids.length; i++) {
        String id = ids[i];
        
        if (id == null) {
            chkBoxes[i] = null;
            continue;
        }
        
        JCheckBox chkBox = new JCheckBox();
        String baseName = "CommonTestsCfgOfCreate.chk" + id;              //NOI18N
        AccessibleContext accessCtx = chkBox.getAccessibleContext();
        Mnemonics.setLocalizedText(
                chkBox,
                bundle.getString(baseName + ".text"));              //NOI18N
        chkBox.setToolTipText(
                bundle.getString(baseName + ".toolTip"));           //NOI18N
        accessCtx.setAccessibleName(
                bundle.getString(baseName + ".AN"));                //NOI18N
        accessCtx.setAccessibleDescription(
                bundle.getString(baseName + ".AD"));                //NOI18N
        
        chkBoxes[i] = chkBox;
    }
    return chkBoxes;
}
 
Example 52
Project: hipee   File: CloudConfigPanel.java   Source Code and License 5 votes vote down vote up
public void loadUI(boolean enable, JCheckBox cloudCheckBox, JButton cloudButton) {
    cloudEnable = dockerConfigPanel.isDockerActivated();
    cloudCheckBox.setSelected(cloudEnable && enable);
    cloudButton.setEnabled(cloudEnable && enable);
    if (!cloudEnable) {
        infoLabel.setText(getMessage(DockerConfigPanel.class, "DOCKER_DISABLED_MESSAGE"));
    } else {
        infoLabel.setText("");
    }
}
 
Example 53
Project: Cognizant-Intelligent-Test-Scripter   File: JCheckBoxTree.java   Source Code and License 5 votes vote down vote up
public CheckBoxCellRenderer() {
    super();
    this.setLayout(new BorderLayout());
    checkBox = new JCheckBox();
    checkBox.setSelectedIcon(selectedIcon);
    add(checkBox, BorderLayout.CENTER);
    setOpaque(false);
}
 
Example 54
Project: incubator-netbeans   File: IssuePanel.java   Source Code and License 5 votes vote down vote up
private void reloadField (Object component, IssueField field) {
    String newValue;
    if (component instanceof JList) {
        newValue = mergeValues(issue.getFieldValues(field));
    } else {
        newValue = issue.getFieldValue(field);
    }
    boolean fieldDirty = unsavedFields.contains(field.getKey());
    if (!fieldDirty) {
        if (component instanceof JComboBox) {
            JComboBox combo = (JComboBox)component;
            selectInCombo(combo, newValue, true);
        } else if (component instanceof JTextComponent) {
            ((JTextComponent)component).setText(newValue);
        } else if (component instanceof JList) {
            JList list = (JList)component;
            list.clearSelection();
            ListModel model = list.getModel();
            for (String value : issue.getFieldValues(field)) {
                for (int i=0; i<model.getSize(); i++) {
                    if (value.equals(model.getElementAt(i))) {
                        list.addSelectionInterval(i, i);
                    }
                }
            }
        } else if (component instanceof JCheckBox) {
            ((JCheckBox) component).setSelected("1".equals(newValue));
        } else if (component instanceof IDEServices.DatePickerComponent) {
            IDEServices.DatePickerComponent picker = (IDEServices.DatePickerComponent) component;
            try {
                picker.setDate(BugzillaIssue.DUE_DATE_FORMAT.parse(newValue));
            } catch (ParseException ex) {
                picker.setDate(null);
            }
        }
    }
}
 
Example 55
Project: incubator-netbeans   File: IssuePanel.java   Source Code and License 5 votes vote down vote up
void fieldModified () {
    if (!reloading && isEnabled()) {
        if (component instanceof JTextComponent) {
            storeFieldValue(field, (JTextComponent) component);
            updateDecorations();
        } else if (component instanceof JList) {
            storeFieldValue(field, (JList) component);
            updateDecorations();
        } else if (component instanceof JComboBox) {
            Object value = ((JComboBox) component).getSelectedItem();
            if (value != null && assignToDefaultCheckBox.isVisible() && !assignToDefaultCheckBox.isSelected()) {
                // when changing component or product, assign to default should be automatically selected
                // as it is in browser 
                if (component == productCombo && !value.equals(issue.getFieldValue(IssueField.PRODUCT))) {
                    assignToDefaultCheckBox.doClick();
                } else if (component == componentCombo && !value.equals(issue.getFieldValue(IssueField.COMPONENT))) {
                    assignToDefaultCheckBox.doClick();
                }
            }
            storeFieldValue(field, (JComboBox) component);
            updateDecorations();
        } else if (component instanceof JCheckBox) {
            storeFieldValue(field, ((JCheckBox) component).isSelected() ? "1" : "0");
            updateDecorations();
        }
    }
}
 
Example 56
Project: Equella   File: ConfigEditorGUI.java   Source Code and License 5 votes vote down vote up
private JComponent buildMiscTab()
{
	// Labels and Controls
	JLabel lblOpt = new JLabel("-- Optional --");
	JLabel lblConPath = new JLabel("Conversion Path: ");
	JLabel lblDevInst = new JLabel("Development Install: ");
	JLabel lblPlug = new JLabel("-- Plugins --");
	JLabel lblImageMagick = new JLabel("Image Magik Path: ");

	pbrImageMagick = new JPathBrowser(JFileChooser.DIRECTORIES_ONLY);
	pbrConPath = new JPathBrowser(JFileChooser.FILES_AND_DIRECTORIES);
	chkDevInst = new JCheckBox();
	chkDevInst.addActionListener(this);

	JSeparator sep1 = new JSeparator();

	// Layout
	JPanel all = new JPanel(new MigLayout("wrap 2, fillx", "[align label][grow, fill]"));
	all.add(lblOpt, "span");

	all.add(lblDevInst);
	all.add(chkDevInst);
	all.add(lblConPath);
	all.add(pbrConPath);

	all.add(sep1, "grow, span");

	all.add(lblPlug, "span");
	all.add(lblImageMagick);
	all.add(pbrImageMagick);

	return all;
}
 
Example 57
Project: jOthelloT   File: Player.java   Source Code and License 4 votes vote down vote up
public JCheckBox getjCheckBox() {
    return jCheckBox;
}
 
Example 58
Project: geomapapp   File: SCSImage2.java   Source Code and License 4 votes vote down vote up
public SCSImage2(SCS scs) {
//		***** GMA 1.6.2: Tool tip text
		setToolTipText("Right-click to digitize");
//		***** GMA 1.6.2
		
		this.scs = scs;
		panels = new Vector();
		zoom = zoomX = zoomY = .25;

		addMouseListener(this);
		addMouseMotionListener(this);

//		***** GMA 1.6.2: Add a pop-up menu that appears when a right-click occurs to allow the user 
//		to record the data for a particular point along the selected SCS leg.
		pm = new JPopupMenu();
		JMenuItem mi = new JMenuItem("Copy Information to Clipboard");
		mi.setActionCommand("copy");
		mi.addActionListener(this);
		pm.add(mi);
//		***** GMA 1.6.2
		zoomer = new Zoomer(this);

//		***** Changed by A.K.M. 1.3.5 *****
//		Implement zoom buttons
		tools = Box.createHorizontalBox();
		buttonGroup = new ButtonGroup();
		buttons = new Vector();

		JToggleButton no = new JToggleButton();
		buttonGroup.add(no);

		zoomInTB = zoomer.getZoomIn();
		zoomInTB.setActionCommand("Zoom In");
		zoomInTB.addActionListener(this);
		zoomInTB.setSelectedIcon( Icons.getIcon( Icons.ZOOM_IN, true ) );
		//buttons.add( zoomInTB );
		buttonGroup.add( zoomInTB );
		tools.add( zoomInTB );
		zoomInTB.setBorder( null );
		zoomInTB.setToolTipText("Ctrl-click");

		zoomOutTB = zoomer.getZoomOut();
		zoomOutTB.setActionCommand("Zoom Out");
		zoomOutTB.addActionListener(this);
		zoomOutTB.setSelectedIcon( Icons.getIcon( Icons.ZOOM_OUT, true ) );
		//buttons.add( zoomOutTB );
		buttonGroup.add( zoomOutTB );
		tools.add( zoomOutTB );
		zoomOutTB.setBorder( null );
		zoomOutTB.setToolTipText("Shift-Ctrl-click");

//		Add toggler so that zoom buttons can be deselected
		new ToggleToggler( zoomInTB, no );
		new ToggleToggler( zoomOutTB, no );
//		***** Changed by A.K.M. 1.3.5 *****

		addMouseListener(zoomer);
		addMouseMotionListener(zoomer);
		addKeyListener(zoomer);

		JButton b = new JButton(Icons.getIcon(Icons.SAVE,false));
		b.setPressedIcon( Icons.getIcon(Icons.SAVE,true) );
		b.setBorder(null);
		b.addActionListener(this);
		tools.add(b);
		b.setToolTipText("Save Image");
		b.setActionCommand("save");

		autoload = new JCheckBox("auto-load");
		autoload.setSelected( false );
		digDir = null;
		cruise = null;

		range = new int[] {-1, -1};
		height = 1334;
		width = 300;
	}
 
Example 59
Project: MonitorYourLAN   File: MainWindow.java   Source Code and License 4 votes vote down vote up
public void setCheckBox_5(JCheckBox checkBox_5) {
	this.checkBox_5 = checkBox_5;
}
 
Example 60
Project: incubator-netbeans   File: IDEValidation.java   Source Code and License 4 votes vote down vote up
/** Test creation of java project. 
 * - open New Project wizard from main menu (File|New Project)
 * - select Java Application project from Standard category
 * - in the next panel type project name and project location in
 * - finish the wizard
 * - wait until project appears in projects view
 * - wait classpath scanning finished
 */
public void testNewProject() {
    NewProjectWizardOperator.invoke().cancel();
    NewProjectWizardOperator npwo = NewProjectWizardOperator.invoke();
    // "Standard"
    String standardLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "Templates/Project/Standard");
    npwo.selectCategory(standardLabel);
    // "Java Application"
    String javaApplicationLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "template_app");
    npwo.selectProject(javaApplicationLabel);
    npwo.next();
    NewJavaProjectNameLocationStepOperator npnlso = new NewJavaProjectNameLocationStepOperator();
    npnlso.txtProjectName().setText(SAMPLE_PROJECT_NAME);
    npnlso.txtProjectLocation().setText(System.getProperty("netbeans.user")); // NOI18N
    npnlso.btFinish().pushNoBlock();
    npnlso.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 120000);
    npnlso.waitClosed();
    // wait project appear in projects view
    new ProjectsTabOperator().getProjectRootNode(SAMPLE_PROJECT_NAME);

    //disable the compile on save:
    ProjectsTabOperator.invoke().getProjectRootNode(SAMPLE_PROJECT_NAME).properties();
    // "Project Properties"
    String projectPropertiesTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Customizer_Title");
    NbDialogOperator propertiesDialogOper = new NbDialogOperator(projectPropertiesTitle);
    // select "Compile" category
    String buildCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_BuildCategory");
    String compileCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_Build");
    new Node(new Node(new JTreeOperator(propertiesDialogOper), buildCategoryTitle), compileCategoryTitle).select();
    // actually disable the quick run:
    String compileOnSaveLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "CustomizerCompile.CompileOnSave");
    JCheckBox cb = JCheckBoxOperator.waitJCheckBox((Container) propertiesDialogOper.getSource(), compileOnSaveLabel, true, true);
    if (cb.isSelected()) {
        cb.doClick();
    }
    // confirm properties dialog
    propertiesDialogOper.ok();

    // wait classpath scanning finished
    WatchProjects.waitScanFinished();
}