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

The following examples show how to use javax.swing.JCheckBox#setHorizontalTextPosition() . 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: CollapsiblePanel.java    From littleluck with Apache License 2.0 6 votes vote down vote up
protected Component createCollapseControl(String title, String tooltip) {
    // Add upper panel to hold collapse control
    Box box = Box.createHorizontalBox();
    expandCheckBox = new JCheckBox(title);
    expandCheckBox.setOpaque(false);
    expandCheckBox.setBorder(new EmptyBorder(0,4,0,0));
    expandCheckBox.setToolTipText(tooltip);
    expandCheckBox.setHorizontalTextPosition(JCheckBox.RIGHT);
    expandCheckBox.setSelectedIcon(new ArrowIcon(ArrowIcon.SOUTH));
    expandCheckBox.setIcon(new ArrowIcon(ArrowIcon.EAST));
    expandCheckBox.setSelected(isExpanded());
    
    expandCheckBox.addChangeListener(new CollapseListener());
    box.add(expandCheckBox);
    
    return box;                       
}
 
Example 2
Source File: CollapsiblePanel.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
protected Component createCollapseControl(String title, String tooltip) {
    // Add upper panel to hold collapse control
    Box box = Box.createHorizontalBox();
    
    expandCheckBox = new JCheckBox(title);
    expandCheckBox.setBorder(new EmptyBorder(0,4,0,0));
    expandCheckBox.setToolTipText(tooltip);
    expandCheckBox.setHorizontalTextPosition(JCheckBox.RIGHT);
    expandCheckBox.setSelectedIcon(new ArrowIcon(ArrowIcon.SOUTH));
    expandCheckBox.setIcon(new ArrowIcon(ArrowIcon.EAST));
    expandCheckBox.setSelected(isExpanded());
    
    expandCheckBox.addChangeListener(new CollapseListener());
    box.add(expandCheckBox);
    
    return box;                       
}
 
Example 3
Source File: ShowNextTime.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Creates a new instance of RecentProjects */
public ShowNextTime() {
    super( new BorderLayout() );
    setOpaque(false);

    button = new JCheckBox( BundleSupport.getLabel( "ShowOnStartup" ) ); // NOI18N
    button.setSelected( WelcomeOptions.getDefault().isShowOnStartup() );
    button.setOpaque( false );
    button.setForeground( Utils.getTopBarForeground() );
    button.setHorizontalTextPosition( SwingConstants.LEFT );
    BundleSupport.setAccessibilityProperties( button, "ShowOnStartup" ); //NOI18N
    add( button, BorderLayout.CENTER );
    button.addActionListener( this );
}
 
Example 4
Source File: REGmodelPanel.java    From iMetrica with GNU General Public License v3.0 5 votes vote down vote up
public void setupRegression()
{

  int i;

  easterDay = new JComboBox<String>(); easterDay.setToolTipText("Check and adjust for Easter-Day effects in data using x-day Easter regressors."); 

  for(i=1;i<16;i++) {easterDay.addItem(Integer.toString(i));}  easterDay.setSelectedIndex(0); 
  easterDay.addActionListener(new MyActionListener());
   
  tdComboBox = new JComboBox<String>(); 
  tdComboBox.setToolTipText("Choose model to associate trading day regression with. Model 0 is implies separate regression term.");
  for(i = 0; i < 1; i++) {tdComboBox.addItem("Separate");}  
  tdComboBox.setSelectedIndex(0);

  easterComboBox = new JComboBox<String>(); 
  easterComboBox.setToolTipText("Choose model to associate easter regression with. Model 0 is implies separate regression term.");
  for(i = 0; i < 1; i++) {easterComboBox.addItem("Separate");}  
  easterComboBox.setSelectedIndex(0);

  tdBox = new JCheckBox("TD:"); tdBox.setHorizontalTextPosition(JLabel.LEFT);
  outlierBox = new JCheckBox("Outliers:");  outlierBox.setHorizontalTextPosition(JLabel.LEFT);

  constantBox = new JCheckBox("Constant:"); constantBox.setHorizontalTextPosition(JLabel.LEFT); 
  easterBox = new JCheckBox("Easter:"); easterBox.setHorizontalTextPosition(JLabel.LEFT);  
  transBox = new JCheckBox("BC-Trans:"); transBox.setHorizontalTextPosition(JLabel.LEFT);  
  transBox.setToolTipText("Set Box-Cox Transformation"); 
  easterBox.setToolTipText("Check and adjust for Easter-Day effects in data using x-day Eastor regressors."); 
  tdBox.setToolTipText("Check and adjust for Trading-Day effects in data. Select models to apply trading day or select time varying trading day.");
  outlierBox.setToolTipText("Check and adjust for outliers in data.");
  constantBox.setToolTipText("Adjust for a constant regression term");
  constantBox.addItemListener(new MyItemListener());

  tdBox.addItemListener(new MyItemListener()); outlierBox.addItemListener(new MyItemListener()); 
  transBox.addItemListener(new MyItemListener()); easterBox.addItemListener(new MyItemListener()); 
  tvreg = new JCheckBox("TV:"); tvreg.setSelected(false); tvreg.addItemListener(new MyItemListener());
  tvreg.setToolTipText("Employ time varying trading day"); tvreg.setHorizontalTextPosition(JLabel.LEFT); 

}
 
Example 5
Source File: IntervalFileChooser.java    From nmonvisualizer with Apache License 2.0 5 votes vote down vote up
public IntervalFileChooser(NMONVisualizerGui gui) {
    super(gui, "Select Interval File", "intervals.properties");

    useRelativeTime = new JCheckBox();
    useRelativeTime.setText("Relative Time?");
    useRelativeTime.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    useRelativeTime.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
    useRelativeTime.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));

    addComponentToChooser(this, null, useRelativeTime);
}
 
Example 6
Source File: MainWindow.java    From ripme with MIT License 4 votes vote down vote up
private static JCheckBox addNewCheckbox(String text, String configString, Boolean configBool) {
    JCheckBox checkbox = new JCheckBox(text, Utils.getConfigBoolean(configString, configBool));
    checkbox.setHorizontalAlignment(JCheckBox.RIGHT);
    checkbox.setHorizontalTextPosition(JCheckBox.LEFT);
    return checkbox;
}
 
Example 7
Source File: ProcessInfoDialog.java    From nmonvisualizer with Apache License 2.0 4 votes vote down vote up
public ProcessInfoDialog(NMONVisualizerGui gui) {
    super(gui);
    setResizable(true);

    setLayout(new BorderLayout());
    setIconImage(PROCESS_ICON.getImage());

    processName = new JLabel();
    processName.setFont(Styles.TITLE);
    processName.setHorizontalAlignment(SwingConstants.CENTER);

    processTime = new JLabel();
    processTime.setFont(Styles.BOLD);
    processTime.setHorizontalAlignment(SwingConstants.CENTER);

    JPanel header = new JPanel();
    header.setLayout(new GridLayout(2, 1));
    header.setBorder(Styles.TITLE_BORDER);
    header.add(processName);
    header.add(processTime);

    add(header, BorderLayout.PAGE_START);

    commandLine = new JTextArea();
    commandLine.setColumns(50);
    commandLine.setRows(15);
    commandLine.setEditable(false);

    JScrollPane scrollPane = new JScrollPane(commandLine);
    scrollPane.setBorder(Styles.DOUBLE_LINE_BORDER);
    add(scrollPane, BorderLayout.CENTER);

    followTree = new JCheckBox("Link with Tree?");
    followTree.setFont(Styles.LABEL);
    followTree.setHorizontalAlignment(SwingConstants.TRAILING);
    followTree.setHorizontalTextPosition(SwingConstants.LEADING);
    followTree.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 10));
    followTree.setSelected(false);

    add(followTree, BorderLayout.PAGE_END);

    tree = null;
}