Java Code Examples for javax.swing.Box

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project jCAE, under directory /jcae/core/src/org/jcae/netbeans/cad/.

Source file: RemoveHoles.java

  22 
vote

private Component createTolerancePanel(){
  Box toReturn=Box.createHorizontalBox();
  toReturn.add(new JLabel("Minimum area"));
  toReturn.add(Box.createHorizontalStrut(5));
  toReturn.add(minAreaField);
  return toReturn;
}
 

Example 2

From project jftp, under directory /src/main/java/com/myjavaworld/gui/.

Source file: LicenseAgreementDlg.java

  22 
vote

private Component getCommandButtons(){
  Box panel=new Box(BoxLayout.X_AXIS);
  butAgree=new MButton(resources.getString("text.agree"));
  butAgree.setActionCommand("cmd.agree");
  butAgree.addActionListener(this);
  butDisagree=new MButton(resources.getString("text.disagree"));
  butDisagree.setActionCommand("cmd.disagree");
  butDisagree.addActionListener(this);
  panel.add(butAgree);
  panel.add(Box.createRigidArea(new Dimension(5,0)));
  panel.add(butDisagree);
  return panel;
}
 

Example 3

From project pegadi, under directory /storysketch/src/main/java/org/pegadi/storysketch/views/.

Source file: ConflictView.java

  22 
vote

public Viewpoint(){
  Box box=Box.createVerticalBox();
  desc.setLineWrap(true);
  desc.setWrapStyleWord(true);
  Set backward=new HashSet();
  backward.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,InputEvent.SHIFT_MASK));
  Set forward=new HashSet();
  forward.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,0));
  desc.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,forward);
  desc.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,backward);
  box.add(new JScrollPane(desc));
  setLayout(new GridLayout(1,1));
  add(box);
}
 

Example 4

From project replication-benchmarker, under directory /src/main/java/jbenchmarker/.

Source file: SimulatorConfigurator.java

  22 
vote

public SimulatorConfigurator(){
  mainWin=new JFrame("SimulatorConfigurator");
  Box b=Box.createHorizontalBox();
  mainWin.add(b);
  jtree=new JTree();
  JPanel confpanel=new JPanel();
  config=Box.createVerticalBox();
  confpanel.add(config);
}
 

Example 5

From project dawn-isencia, under directory /com.isencia.passerelle.commons/src/main/java/com/isencia/util/swing/components/.

Source file: FinderAccessory.java

  21 
vote

/** 
 * @param parent JFileChooser containing this accessory
 */
public FinderAccessory(JFileChooser parent){
  setBorder(new TitledBorder(ACCESSORY_NAME));
  setLayout(new BorderLayout());
  Box formBox=Box.createVerticalBox();
  valueField=new FormField();
  valueField.setEditable(true);
  JLabel extLbl=new JLabel("Selected extensions");
  extLbl.setToolTipText("Enter one or more file extensions, separated by spaces. E.g. [txt xml java]");
  formBox.add(new FormEntry(extLbl,valueField));
  add(formBox,BorderLayout.NORTH);
  valueField.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      pushExtensions();
    }
  }
);
  chooser=parent;
}
 

Example 6

From project FML, under directory /common/cpw/mods/fml/relauncher/.

Source file: Downloader.java

  21 
vote

private Box makeProgressPanel(){
  Box box=Box.createVerticalBox();
  box.add(Box.createRigidArea(new Dimension(0,10)));
  JLabel welcomeLabel=new JLabel("<html><b><font size='+1'>FML is setting up your minecraft environment</font></b></html>");
  box.add(welcomeLabel);
  welcomeLabel.setAlignmentY(LEFT_ALIGNMENT);
  welcomeLabel=new JLabel("<html>Please wait, FML has some tasks to do before you can play</html>");
  welcomeLabel.setAlignmentY(LEFT_ALIGNMENT);
  box.add(welcomeLabel);
  box.add(Box.createRigidArea(new Dimension(0,10)));
  currentActivity=new JLabel("Currently doing ...");
  box.add(currentActivity);
  box.add(Box.createRigidArea(new Dimension(0,10)));
  progress=new JProgressBar(0,100);
  progress.setStringPainted(true);
  box.add(progress);
  box.add(Box.createRigidArea(new Dimension(0,30)));
  return box;
}
 

Example 7

From project GenericKnimeNodes, under directory /com.genericworkflownodes.knime.base_plugin/src/com/genericworkflownodes/knime/generic_node/dialogs/param_dialog/itemlist/.

Source file: ChoiceDialog.java

  21 
vote

private void init(){
  list=new JList(values);
  list.setFixedCellWidth(200);
  JScrollPane listScrollPane=new JScrollPane(list);
  list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  addButton=new JButton("Pick");
  addButton.addActionListener(this);
  Box box=Box.createVerticalBox();
  box.add(listScrollPane);
  box.add(addButton);
  box.add(Box.createVerticalGlue());
  this.setContentPane(box);
  setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  setModalityType(ModalityType.APPLICATION_MODAL);
  setSize(300,200);
  pack();
}
 

Example 8

From project gridland, under directory /src/org/grid/server/.

Source file: ClientsPanel.java

  21 
vote

private ClientPanel(Client cl){
  super();
  this.client=cl;
  client.addListener(this);
  setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  setLayout(new BorderLayout(3,3));
  Box box=new Box(BoxLayout.Y_AXIS);
  add(box,BorderLayout.CENTER);
  clientInfo.setPreferredSize(new Dimension(500,30));
  clientInfo.setFont(getFont().deriveFont(Font.BOLD,12.0f));
  agentInfo.setFont(getFont().deriveFont(Font.PLAIN,9.0f));
  box.add(clientInfo);
  box.add(agentInfo);
  clientInfo.setText(client.toString());
  agentInfo.setText("n/a");
  Box side=new Box(BoxLayout.X_AXIS);
  add(side,BorderLayout.EAST);
  side.add(traffic);
  buttons=new JPanel(new StackLayout(Orientation.HORIZONTAL));
  buttons.setOpaque(false);
  buttons.add(Box.createHorizontalStrut(5));
  buttons.add(disconnect);
  buttons.add(Box.createHorizontalStrut(5));
  buttons.add(kill);
  addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent e){
      ClientsPanel.this.select(ClientPanel.this.client);
    }
  }
);
}
 

Example 9

From project jmeter-amf, under directory /src/protocol/amf/org/apache/jmeter/protocol/amf/gui/.

Source file: AmfProxyControlGui.java

  21 
vote

private void init(){
  setLayout(new BorderLayout(0,5));
  setBorder(makeBorder());
  add(makeTitlePanel(),BorderLayout.NORTH);
  JPanel mainPanel=new JPanel(new BorderLayout());
  Box myBox=Box.createVerticalBox();
  myBox.add(createPortPanel());
  myBox.add(Box.createVerticalStrut(5));
  myBox.add(createTestPlanContentPanel());
  myBox.add(Box.createVerticalStrut(5));
  myBox.add(createHTTPSamplerPanel());
  myBox.add(Box.createVerticalStrut(5));
  myBox.add(createContentTypePanel());
  myBox.add(Box.createVerticalStrut(5));
  mainPanel.add(myBox,BorderLayout.NORTH);
  Box includeExcludePanel=Box.createVerticalBox();
  includeExcludePanel.add(createIncludePanel());
  includeExcludePanel.add(createExcludePanel());
  mainPanel.add(includeExcludePanel,BorderLayout.CENTER);
  mainPanel.add(createControls(),BorderLayout.SOUTH);
  add(mainPanel,BorderLayout.CENTER);
}
 

Example 10

From project jreepad, under directory /src/jreepad/.

Source file: JreepadViewer.java

  21 
vote

public void establishAutosaveDialogue(){
  Box vBox, hBox;
  autoSaveDialog=new JDialog(this,lang.getString("AUTOSAVE"),true);
  autoSaveDialog.setVisible(false);
  vBox=Box.createVerticalBox();
  vBox.add(Box.createGlue());
  hBox=Box.createHorizontalBox();
  hBox.add(autoSaveCheckBox=new JCheckBox(lang.getString("AUTOSAVE_EVERY"),getPrefs().autoSave));
  hBox.add(autoSavePeriodSpinner=new JSpinner(new SpinnerNumberModel(getPrefs().autoSavePeriod,1,1000,1)));
  hBox.add(new JLabel(lang.getString("AUTOSAVE_MINUTES")));
  vBox.add(hBox);
  vBox.add(Box.createGlue());
  hBox=Box.createHorizontalBox();
  hBox.add(autoSaveOkButton=new JButton(lang.getString("OK")));
  hBox.add(autoSaveCancelButton=new JButton(lang.getString("CANCEL")));
  autoSaveOkButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      getPrefs().autoSavePeriod=((Integer)(autoSavePeriodSpinner.getValue())).intValue();
      getPrefs().autoSave=autoSaveCheckBox.isSelected();
      autoSaveDialog.setVisible(false);
      if (getPrefs().autoSave && !(autoSaveThread.isAlive())) {
        autoSaveWarningMessage();
        autoSaveThread.start();
      }
      updateWindowTitle();
    }
  }
);
  autoSaveCancelButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      autoSaveDialog.setVisible(false);
    }
  }
);
  vBox.add(Box.createGlue());
  vBox.add(hBox);
  autoSaveDialog.getContentPane().add(vBox);
}
 

Example 11

From project sikuli, under directory /extensions/guide/src/main/java/org/sikuli/guide/.

Source file: SklStoryRunner.java

  21 
vote

ListCellTile(JComponent comp){
  setOpaque(true);
  setLayout(new BorderLayout());
  setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
  inner=new JPanel();
  inner.setLayout(new BorderLayout());
  _indexLabel.setFont(new Font("sansserif",Font.BOLD,16));
  inner.add(_indexLabel,BorderLayout.WEST);
  inner.add(comp,BorderLayout.CENTER);
  inner.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
  Box bottomRow=new Box(BoxLayout.X_AXIS);
  bottomRow.add(_statusLabel);
  bottomRow.add(Box.createHorizontalGlue());
  bottomRow.add(_elapsedTimeLabel);
  inner.add(bottomRow,BorderLayout.SOUTH);
  add(inner,BorderLayout.CENTER);
  addMouseListener(new MouseListener(){
    @Override public void mouseClicked(    MouseEvent arg0){
    }
    @Override public void mouseEntered(    MouseEvent arg0){
    }
    @Override public void mouseExited(    MouseEvent arg0){
    }
    @Override public void mousePressed(    MouseEvent arg0){
      Debug.info("mouse pressed");
    }
    @Override public void mouseReleased(    MouseEvent arg0){
    }
  }
);
}
 

Example 12

From project spring-flex, under directory /spring-flex-samples/spring-flex-testdrive/testdrive/src/main/java/org/springframework/flex/samples/jmschat/.

Source file: JMSChat.java

  21 
vote

public JMSChat(){
  try {
    ActiveMQConnectionFactory factory=new ActiveMQConnectionFactory(this.url);
    this.connection=factory.createConnection();
    this.session=this.connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    this.topic=this.session.createTopic("sampletopic.flex.jms.chat");
    MessageConsumer consumer=this.session.createConsumer(this.topic);
    consumer.setMessageListener(this);
    this.producer=this.session.createProducer(this.topic);
    this.producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
    this.connection.start();
  }
 catch (  JMSException e) {
    e.printStackTrace();
  }
  JFrame frame=new JFrame("JMS Chat");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  this.taChat=new JTextArea();
  frame.getContentPane().add(this.taChat,BorderLayout.CENTER);
  Box north=new Box(BoxLayout.X_AXIS);
  north.add(new JLabel("User Name:"));
  this.tfUser=new JTextField();
  north.add(this.tfUser);
  frame.getContentPane().add(north,BorderLayout.NORTH);
  Box south=new Box(BoxLayout.X_AXIS);
  south.add(new JLabel("Message:"));
  this.tfMessage=new JTextField();
  south.add(this.tfMessage);
  JButton btSend=new JButton("Send");
  btSend.addActionListener(this);
  south.add(btSend);
  frame.getContentPane().add(south,BorderLayout.SOUTH);
  int width=300;
  int height=300;
  frame.setSize(width,height);
  frame.setVisible(true);
}
 

Example 13

From project uncommons-maths, under directory /demo/src/java/main/org/uncommons/maths/demo/.

Source file: RandomDemo.java

  21 
vote

private JComponent createControls(){
  Box controls=new Box(BoxLayout.Y_AXIS);
  controls.add(distributionPanel);
  controls.add(rngPanel);
  JButton executeButton=new JButton("Go");
  executeButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent actionEvent){
      RandomDemo.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      new SwingBackgroundTask<GraphData>(){
        private ProbabilityDistribution distribution;
        protected GraphData performTask(){
          distribution=distributionPanel.createProbabilityDistribution();
          Map<Double,Double> observedValues=distribution.generateValues(rngPanel.getIterations(),rngPanel.getRNG());
          Map<Double,Double> expectedValues=distribution.getExpectedValues();
          return new GraphData(observedValues,expectedValues,distribution.getExpectedMean(),distribution.getExpectedStandardDeviation());
        }
        protected void postProcessing(        GraphData data){
          graphPanel.generateGraph(distribution.getDescription(),data.getObservedValues(),data.getExpectedValues(),data.getExpectedMean(),data.getExpectedStandardDeviation(),distribution.isDiscrete());
          RandomDemo.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        }
      }
.execute();
    }
  }
);
  controls.add(executeButton);
  return controls;
}
 

Example 14

From project addis, under directory /application/src/main/java/org/drugis/addis/gui/.

Source file: AddisWindow.java

  19 
vote

private void initMenu(){
  JMenuBar menuBar=new JMenuBar();
  menuBar.add(createFileMenu());
  menuBar.add(createEditMenu());
  menuBar.add(createAddMenu());
  menuBar.add(Box.createHorizontalGlue());
  menuBar.add(createHelpMenu());
  setJMenuBar(menuBar);
}
 

Example 15

From project autopsy, under directory /Core/src/org/sleuthkit/autopsy/casemodule/.

Source file: AddImageVisualPanel2.java

  19 
vote

private void customizeComponents(){
  progressLabel=new JLabel();
  infoPanel.setLayout(new BoxLayout(infoPanel,BoxLayout.PAGE_AXIS));
  infoPanel.add(progressLabel);
  infoPanel.add(Box.createRigidArea(new Dimension(10,10)));
}
 

Example 16

From project Bit4Tat, under directory /Bit4Tat/src/com/Bit4Tat/.

Source file: BitPanel.java

  19 
vote

public SubPanel(String header){
  this.setDoubleBuffered(true);
  this.setBackground(Color.WHITE);
  this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
  HeaderLabel headerText=new HeaderLabel(header);
  this.add(Box.createRigidArea(new Dimension(10,0)));
  this.add(Box.createRigidArea(new Dimension(0,10)));
  this.add(headerText);
}
 

Example 17

From project BMach, under directory /src/bmach/ui/gui/components/.

Source file: JAddressPanel.java

  19 
vote

private void initComponents(){
  this.addressLabel=new JLabel("0x00");
  this.addressLabel.setFont(addressFont);
  this.setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
  this.add(Box.createHorizontalStrut(10));
  this.add(addressLabel);
  this.add(Box.createHorizontalStrut(5));
  this.setPreferredSize(new Dimension(50,30));
}
 

Example 18

From project codjo-data-process, under directory /codjo-data-process-gui/src/main/java/net/codjo/dataprocess/gui/plugin/.

Source file: DataProcessGuiPlugin.java

  19 
vote

public void updateToolBar(){
  String repositoryId=configuration.getUser().getCurrentRepository();
  ToolbarRepoConfig toolbarRepoConfig=configuration.getToolBarRepoConfig(repositoryId);
  toolBarPanel.invalidate();
  toolBarPanel.removeAll();
  JPanel jPanel=new JPanel();
  jPanel.setLayout(new BoxLayout(jPanel,BoxLayout.LINE_AXIS));
  jPanel.add(repositoryPanel);
  jPanel.add(Box.createRigidArea(new Dimension(100,0)));
  toolBarPanel.add(jPanel,BorderLayout.EAST);
  if (toolbarRepoConfig != null) {
    toolBarPanel.add(toolbarRepoConfig.build(ctxt,configuration),BorderLayout.WEST);
  }
 else {
    toolBarPanel.add(new DefaultToolbarRepoConfig().build(ctxt,configuration),BorderLayout.WEST);
  }
  toolBarPanel.validate();
}
 

Example 19

From project contribution_eevolution_smart_browser, under directory /client/src/org/compiere/apps/.

Source file: ProcessParameterPanel.java

  19 
vote

private void createField(ResultSet rs,int row,int col){
  GridFieldVO voF=GridFieldVO.createParameter(Env.getCtx(),m_WindowNo,rs);
  GridField mField=new GridField(voF);
  m_mFields.add(mField);
  JLabel label=VEditorFactory.getLabel(mField);
  if (label == null) {
    centerPanel.add(Box.createHorizontalStrut(12),new ALayoutConstraint(row,col));
  }
 else {
    centerPanel.add(label,new ALayoutConstraint(row,col));
  }
  VEditor vEditor=VEditorFactory.getEditor(mField,false);
  vEditor.addVetoableChangeListener(this);
  mField.addPropertyChangeListener(vEditor);
  centerPanel.add((Component)vEditor,new ALayoutConstraint(row,col + 1));
  m_vEditors.add(vEditor);
  Object defaultObject=mField.getDefault();
  mField.setValue(defaultObject,true);
  if (voF.isRange) {
    JLabel dash=new JLabel(" - ");
    centerPanel.add(dash,new ALayoutConstraint(row,col + 2));
    m_separators.add(dash);
    GridFieldVO voF2=GridFieldVO.createParameter(voF);
    GridField mField2=new GridField(voF2);
    m_mFields2.add(mField2);
    VEditor vEditor2=VEditorFactory.getEditor(mField2,false);
    mField2.addPropertyChangeListener(vEditor2);
    centerPanel.add((Component)vEditor2,new ALayoutConstraint(row,col + 3));
    m_vEditors2.add(vEditor2);
    Object defaultObject2=mField2.getDefault();
    mField2.setValue(defaultObject2,true);
  }
 else {
    m_separators.add(null);
    m_mFields2.add(null);
    m_vEditors2.add(null);
  }
}
 

Example 20

From project formic, under directory /src/java/org/formic/wizard/step/gui/.

Source file: InstallStep.java

  19 
vote

/** 
 * {@inheritDoc}
 * @see org.formic.wizard.step.GuiStep#init()
 */
public Component init(){
  overallLabel=new JLabel(Installer.getString(getName() + ".initialize"));
  overallLabel.setAlignmentX(0.0f);
  overallProgress=new JProgressBar();
  overallProgress.setAlignmentX(0.0f);
  overallProgress.setStringPainted(true);
  taskLabel=new JLabel();
  taskLabel.setAlignmentX(0.0f);
  taskProgress=new JProgressBar();
  taskProgress.setAlignmentX(0.0f);
  taskProgress.setStringPainted(true);
  taskProgress.setIndeterminate(true);
  JPanel panel=new JPanel();
  panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
  panel.setBorder(BorderFactory.createEmptyBorder(50,25,10,25));
  panel.add(overallProgress);
  panel.add(Box.createRigidArea(new Dimension(0,5)));
  panel.add(overallLabel);
  panel.add(Box.createRigidArea(new Dimension(0,20)));
  panel.add(taskProgress);
  panel.add(Box.createRigidArea(new Dimension(0,5)));
  panel.add(taskLabel);
  panel.add(Box.createRigidArea(new Dimension(0,25)));
  JPanel buttons=new JPanel(new FlowLayout(FlowLayout.RIGHT,0,0));
  buttons.setAlignmentX(0.0f);
  showErrorButton=new JButton(new ShowErrorAction());
  showErrorButton.setVisible(false);
  buttons.add(showErrorButton);
  panel.add(buttons);
  return panel;
}
 

Example 21

From project freemind, under directory /freemind/freemind/controller/filter/.

Source file: FilterToolbar.java

  19 
vote

void initConditions(){
  try {
    fc.loadConditions(fc.getFilterConditionModel(),pathToFilterFile);
  }
 catch (  Exception e) {
  }
  addStandardConditions();
  activeFilterConditionComboBox.setSelectedIndex(0);
  activeFilterConditionComboBox.setRenderer(fc.getConditionRenderer());
  add(activeFilterConditionComboBox);
  add(Box.createHorizontalGlue());
  activeFilterConditionComboBox.addItemListener(filterChangeListener);
  activeFilterConditionComboBox.addPropertyChangeListener(filterChangeListener);
}
 

Example 22

From project Java3DTest, under directory /Java3D/src/.

Source file: CurrentShapesPanel.java

  19 
vote

public CurrentShapesPanel(JPanel panel){
  panel.setLayout(new BorderLayout());
  JLabel resize_title=new JLabel("S H A P E S");
  resize_title.setOpaque(true);
  resize_title.setBackground(Color.lightGray);
  panel.add(resize_title,BorderLayout.PAGE_START);
  JPanel currentShapesPanel=new JPanel();
  panel.add(currentShapesPanel);
  listModel=new DefaultListModel();
  list=new JList(listModel);
  list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  list.addListSelectionListener(this);
  list.addKeyListener(this);
  list.addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent evt){
      Enumeration e=GUI_3D.getSwingTest().getSceneBranchGroup().getAllChildren();
      int index=0;
      while (e.hasMoreElements() != false) {
        Object sgObject=((SceneGraphObject)(e.nextElement()));
        if (((String)((Group)((Group)(((Group)sgObject).getChild(0))).getChild(0)).getChild(0).getUserData()).equalsIgnoreCase((String)list.getSelectedValue())) {
          GUI_3D.getSwingTest().setShapeClicked(((Group)((Group)(((Group)sgObject).getChild(0))).getChild(0)).getChild(0));
          System.out.println(GUI_3D.getSwingTest().getShapeClicked());
        }
      }
    }
  }
);
  JScrollPane listScroll=new JScrollPane(list);
  listScroll.setBorder(BorderFactory.createMatteBorder(0,0,0,0,Color.GRAY));
  listScroll.setPreferredSize(new Dimension(147,143));
  currentShapesPanel.add(listScroll);
  currentShapesPanel.add(Box.createVerticalGlue());
  list.setFixedCellHeight(27);
}
 

Example 23

From project jchempaint, under directory /src/main/org/openscience/jchempaint/dialog/.

Source file: EnterElementOrGroupDialog.java

  19 
vote

private EnterElementOrGroupDialog(Frame frame,Component locationComp,String labelText,String title,Object[] data,String initialValue,String longValue){
  super(frame,title,true);
  JButton cancelButton=new JButton(GT._("Cancel"));
  cancelButton.addActionListener(this);
  final JButton setButton=new JButton(GT._("OK"));
  setButton.setName("ok");
  setButton.setActionCommand("Set");
  setButton.addActionListener(this);
  getRootPane().setDefaultButton(setButton);
  list=new JComboBox(data);
  list.setEditable(true);
  JPanel listPane=new JPanel();
  listPane.setLayout(new BoxLayout(listPane,BoxLayout.PAGE_AXIS));
  JLabel label=new JLabel(labelText);
  label.setLabelFor(list);
  listPane.add(label);
  listPane.add(Box.createRigidArea(new Dimension(0,5)));
  listPane.add(list);
  listPane.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
  JPanel buttonPane=new JPanel();
  buttonPane.setLayout(new BoxLayout(buttonPane,BoxLayout.LINE_AXIS));
  buttonPane.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
  buttonPane.add(Box.createHorizontalGlue());
  buttonPane.add(cancelButton);
  buttonPane.add(Box.createRigidArea(new Dimension(10,0)));
  buttonPane.add(setButton);
  Container contentPane=getContentPane();
  contentPane.add(listPane,BorderLayout.CENTER);
  contentPane.add(buttonPane,BorderLayout.PAGE_END);
  pack();
  setLocationRelativeTo(locationComp);
}
 

Example 24

From project jsmaa, under directory /main/src/main/java/fi/smaa/jsmaa/gui/.

Source file: AbstractGUIFactory.java

  19 
vote

private JMenuBar buildMenuBar(){
  JMenuBar menuBar=new JMenuBar();
  menuBar.putClientProperty(Options.HEADER_STYLE_KEY,HeaderStyle.BOTH);
  for (  JMenuItem l : getEntityMenuList()) {
    menuBar.add(l);
  }
  menuBar.add(buildResultsMenu());
  menuBar.add(Box.createHorizontalGlue());
  menuBar.add(buildHelpMenu());
  return menuBar;
}
 

Example 25

From project kabeja, under directory /blocks/ui/src/main/java/org/kabeja/ui/impl/.

Source file: ProcessingUI.java

  19 
vote

protected void initialize(){
  this.frame=new JFrame(Messages.getString("ProcessingUI.title"));
  this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  panel=new JPanel();
  panel.setBorder(BorderFactory.createEmptyBorder());
  mainContainer=new CardLayout();
  mainPanel=new JPanel(mainContainer);
  toolbar=new JToolBar();
  toolbar.add(Box.createHorizontalGlue());
  selector=new SelectorComponent();
  toolbar.add(selector.getView());
  frame.getContentPane().add(toolbar,BorderLayout.NORTH);
  this.menubar=new JMenuBar();
  this.frame.setJMenuBar(this.menubar);
  this.menubar.add(Box.createHorizontalGlue());
  JMenu menu=new JMenu(Messages.getString("ProcessingUI.menu.help"));
  menu.add(new AboutAction());
  this.menubar.add(menu);
  this.menus.put(ApplicationMenuBar.MENU_ID_HELP,menu);
  menu=new JMenu(Messages.getString("ProcessingUI.menu.file"));
  menu.add(new AbstractAction(Messages.getString("ProcessingUI.menu.file.exit")){
    public void actionPerformed(    ActionEvent e){
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          shutdown();
        }
      }
);
    }
  }
);
  this.setMenu(ApplicationMenuBar.MENU_ID_FILE,menu);
  this.frame.getContentPane().add(mainPanel,BorderLayout.CENTER);
  this.frame.setSize(700,620);
  this.frame.validate();
}
 

Example 26

From project LateralGM, under directory /org/lateralgm/main/.

Source file: LGM.java

  19 
vote

private static JToolBar createToolBar(){
  tool=new JToolBar();
  tool.setFloatable(false);
  tool.add(makeButton("Toolbar.OPEN"));
  tool.add(makeButton("Toolbar.SAVE"));
  tool.addSeparator();
  tool.add(makeButton("Toolbar.SAVEAS"));
  tool.addSeparator();
  for (  Class<? extends Resource<?,?>> k : Resource.kinds)   if (InstantiableResource.class.isAssignableFrom(k)) {
    Icon ico=ResNode.ICON.get(k);
    if (ico == null)     ico=GmTreeGraphics.getBlankIcon();
    JButton but=new JButton(ico);
    but.setToolTipText(Messages.format("Toolbar.ADD",Resource.kindNames.get(k)));
    but.addActionListener(new Listener.ResourceAdder(false,k));
    tool.add(but);
  }
  tool.addSeparator();
  tool.add(Box.createHorizontalGlue());
  tool.add(eventButton=makeButton(new JToggleButton(),"Toolbar.EVENT_BUTTON"));
  return tool;
}
 

Example 27

From project Maimonides, under directory /src/com/codeko/apps/maimonides/conf/.

Source file: PanelInfoConfiguracion.java

  19 
vote

@Override protected void succeeded(ArrayList<Component> result){
  removeAll();
  if (result.isEmpty()) {
    getParent().remove(auto);
  }
 else {
    for (    Component c : result) {
      add(c);
      add(Box.createRigidArea(new Dimension(10,6)));
    }
    updateUI();
  }
}
 

Example 28

From project maple-ide, under directory /build/windows/launcher/launch4j/src/net/sf/launch4j/form/.

Source file: BasicForm.java

  19 
vote

/** 
 * Adds fill components to empty cells in the first row and first column of the grid. This ensures that the grid spacing will be the same as shown in the designer.
 * @param cols an array of column indices in the first row where fill components should be added.
 * @param rows an array of row indices in the first column where fill components should be added.
 */
void addFillComponents(Container panel,int[] cols,int[] rows){
  Dimension filler=new Dimension(10,10);
  boolean filled_cell_11=false;
  CellConstraints cc=new CellConstraints();
  if (cols.length > 0 && rows.length > 0) {
    if (cols[0] == 1 && rows[0] == 1) {
      panel.add(Box.createRigidArea(filler),cc.xy(1,1));
      filled_cell_11=true;
    }
  }
  for (int index=0; index < cols.length; index++) {
    if (cols[index] == 1 && filled_cell_11) {
      continue;
    }
    panel.add(Box.createRigidArea(filler),cc.xy(cols[index],1));
  }
  for (int index=0; index < rows.length; index++) {
    if (rows[index] == 1 && filled_cell_11) {
      continue;
    }
    panel.add(Box.createRigidArea(filler),cc.xy(1,rows[index]));
  }
}
 

Example 29

From project medsavant, under directory /medsavant/MedSavantClient/src/org/ut/biolab/medsavant/aggregate/.

Source file: AggregatesStatsPanel.java

  19 
vote

private void initToolBar(){
  toolBarPanel=ViewUtil.getSubBannerPanel("Aggregate variants by");
  JToolBar bar=new JToolBar();
  bar.setFloatable(false);
  toolBarPanel.add(ViewUtil.clear(bar));
  toolBarPanel.add(Box.createHorizontalGlue());
  JComboBox b=new JComboBox();
  for (  String regionStatsName : panelMap.keySet()) {
    b.addItem(regionStatsName);
  }
  setCurrentRegionStats(panelMap.firstKey());
  b.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      JComboBox cb=(JComboBox)e.getSource();
      String regionStatsName=(String)cb.getSelectedItem();
      setCurrentRegionStats(regionStatsName);
      updateRegionStats();
    }
  }
);
  bar.add(b);
  this.add(toolBarPanel,BorderLayout.NORTH);
  this.updateUI();
}
 

Example 30

From project movsim, under directory /viewer/src/main/java/org/movsim/viewer/ui/.

Source file: StatusPanel.java

  19 
vote

public void addStatusView(){
  add(lblScenario);
  add(lblCurrentScenario);
  add(Box.createRigidArea(new Dimension(6,22)));
  add(lblSimTime);
  add(lblTimeDisplay);
  add(Box.createRigidArea(new Dimension(6,22)));
  add(lblTimeWarp);
  add(lblTimeWarpDisplay);
  add(Box.createRigidArea(new Dimension(6,22)));
  add(lblDeltaTime);
  add(lblDeltaTimeDisplay);
  add(Box.createRigidArea(new Dimension(6,22)));
  add(lblVehicleCount);
  add(lblVehicleCountDisplay);
  add(Box.createRigidArea(new Dimension(6,22)));
  if (isWithFiniteDurationAndProgressBar()) {
    add(progressBar);
  }
}
 

Example 31

From project mtc, under directory /mtc-gui/src/main/java/org/drugis/mtc/gui/.

Source file: AuxComponentFactory.java

  19 
vote

public static JPanel createWarningPanel(String warningText){
  Icon icon=UIManager.getIcon("OptionPane.warningIcon");
  if (icon == null) {
    icon=MainWindow.IMAGELOADER.getIcon(FileNames.ICON_WARNING);
  }
  JLabel iconLabel=new JLabel(icon);
  JTextPane textPane=new JTextPane();
  textPane.setText(warningText);
  textPane.setEditable(false);
  textPane.setOpaque(false);
  JPanel panel=new JPanel();
  panel.setLayout(new BoxLayout(panel,BoxLayout.LINE_AXIS));
  panel.setBackground(GUIHelper.COLOR_WARNING);
  panel.add(Box.createRigidArea(new Dimension(8,0)));
  panel.add(iconLabel);
  panel.add(Box.createRigidArea(new Dimension(8,0)));
  panel.add(textPane);
  panel.add(Box.createRigidArea(new Dimension(8,0)));
  return panel;
}
 

Example 32

From project OpenLogViewer, under directory /src/main/java/org/diyefi/openlogviewer/.

Source file: NavBarPanel.java

  19 
vote

public NavBarPanel(){
  setName(NavBarPanel.class.getSimpleName());
  setPreferredSize(new Dimension(PREFERRED_WIDTH,PREFERRED_HEIGHT));
  setLayout(new FlowLayout(FlowLayout.RIGHT,0,0));
  setupZoomButtons();
  add(Box.createHorizontalStrut(SPACER_WIDTH));
  setupPlayButtons();
  add(Box.createHorizontalStrut(SPACER_WIDTH));
  setupNavigationButtons();
  add(Box.createHorizontalStrut(SPACER_WIDTH));
  setupFileButtons();
}
 

Example 33

From project OWASP-WebScarab, under directory /src/org/owasp/webscarab/util/swing/.

Source file: MultiLineTreeCellRenderer.java

  19 
vote

public MultiLineTreeCellRenderer(){
  setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
  _icon=new JLabel(){
    /** 
 */
    private static final long serialVersionUID=1750349321755256468L;
    public void setBackground(    Color color){
      if (color instanceof ColorUIResource)       color=null;
      super.setBackground(color);
    }
  }
;
  add(_icon);
  add(Box.createHorizontalStrut(4));
  add(_text=new TreeTextArea());
  _text.setFont(new Font("Monospaced",0,12));
}
 

Example 34

From project parasim, under directory /extensions/visualisation-plot-impl/src/main/java/org/sybila/parasim/visualisation/plot/impl/gui/.

Source file: ProjectionPlotter.java

  19 
vote

private void initAxes(ResultPlotterConfiguration conf,String xAxe,String yAxe){
  AxisChooser[] axisChoosers=AxisChooser.getPairedAxes(dimension,names,new ActionListener(){
    @Override public void actionPerformed(    ActionEvent ae){
      updateAxes();
    }
  }
);
  xAxis=axisChoosers[0];
  yAxis=axisChoosers[1];
  JPanel bottom=new JPanel();
  bottom.setLayout(new BoxLayout(bottom,BoxLayout.PAGE_AXIS));
  axes=new JPanel();
  axes.setLayout(new BoxLayout(axes,BoxLayout.LINE_AXIS));
  axes.setBorder(new EmptyBorder(PADDING));
  axes.add(new JLabel(xAxe));
  axes.add(Box.createRigidArea(new Dimension(INSET,INSET)));
  axes.add(xAxis);
  axes.add(Box.createRigidArea(new Dimension(2 * INSET,INSET)));
  axes.add(new JLabel(yAxe));
  axes.add(Box.createRigidArea(new Dimension(INSET,INSET)));
  axes.add(yAxis);
  axes.add(Box.createHorizontalGlue());
  bottom.add(axes);
  status=new StatusBar(conf,dimension,names);
  bottom.add(status);
  add(bottom,BorderLayout.PAGE_END);
}
 

Example 35

From project PenguinCMS, under directory /PenguinCMS/tests/vendor/sahi/src/net/sf/sahi/ui/.

Source file: Dashboard.java

  19 
vote

private void buildUI(){
  masterPanel=new JPanel();
  masterPanel.setBackground(new Color(255,255,255));
  masterPanel.add(Box.createRigidArea(new Dimension(120,5)));
  masterPanel.add(getBrowserButtons());
  masterPanel.add(Box.createRigidArea(new Dimension(120,15)));
  masterPanel.add(getLogo());
  masterPanel.add(Box.createRigidArea(new Dimension(120,15)));
  masterPanel.add(getLinksPanel1());
  masterPanel.add(Box.createRigidArea(new Dimension(120,2)));
  masterPanel.add(getLinksPanel2());
  masterPanel.add(Box.createRigidArea(new Dimension(120,2)));
  masterPanel.add(getLinksPanel3());
  add(masterPanel);
}
 

Example 36

From project PhonePledge, under directory /src/phonepledge/server/gui/.

Source file: TickerLabel.java

  19 
vote

private boolean nextText(){
  text=nextText;
  if (text == null)   return false;
  this.removeAll();
  p[pIndex]=new JPanel();
  p[pIndex].setOpaque(false);
  p[pIndex].setForeground(Color.white);
  p[pIndex].setLayout(new BoxLayout(p[pIndex],BoxLayout.LINE_AXIS));
  int totHeight=icon.getIconHeight();
  int totWidth=0;
  int strutWidth=40;
  final FontMetrics metrics=getFontMetrics(font);
  for (int i=0; i < text.length; i++) {
    JLabel l=new JLabel(text[i]);
    l.setIcon(icon);
    l.setFont(font);
    l.setForeground(Color.white);
    l.setIconTextGap(5);
    l.setOpaque(false);
    int width=metrics.stringWidth(text[i]) + icon.getIconWidth() + l.getIconTextGap();
    l.setSize(width,totHeight);
    p[pIndex].add(l);
    Component strut=Box.createHorizontalStrut(strutWidth);
    p[pIndex].add(strut);
    totWidth+=width + strutWidth;
  }
  p[pIndex].setSize(totWidth,totHeight);
  p[pIndex].doLayout();
  p[pIndex].setVisible(true);
  p[pIndex].setLocation(getWidth(),0);
  add(p[pIndex]);
  return true;
}
 

Example 37

From project Pipeline, under directory /src/gui/figure/series/.

Source file: LegendConfigFrame.java

  19 
vote

/** 
 * Removes everything from contentPanel and then generates new info for each passed in  series and adds it all to the content panel, and finally makes this frame visible.
 * @param seriesList
 */
public void display(List<SeriesElement> seriesList){
  contentPanel.removeAll();
  for (  SeriesElement series : seriesList) {
    if (series instanceof XYSeriesElement) {
      JPanel panel=addPanelForSeries((XYSeriesElement)series);
      contentPanel.add(panel);
      contentPanel.add(Box.createVerticalGlue());
    }
 else {
      throw new IllegalArgumentException("The default legend config frame cannot currently handle series that aren't XY series.");
    }
  }
  setVisible(true);
  invalidate();
  validate();
  repaint();
}
 

Example 38

From project pivote-java, under directory /swing-client/src/main/java/ch/piratenpartei/pivote/ui/cert/.

Source file: CertificateManager.java

  19 
vote

@Override protected JPanel buildUi(){
  JPanel root=new JPanel(new BorderLayout());
  JToolBar toolbar=context().require(ActionPresenter.class).builder(JToolBar.class).addFlat(new ActionGroupBuilder(new CommonActionGroup("Toolbar")).add(new CommonAction(res,"newCertificate"){
    @Override public void actionPerformed(    ActionEvent e){
    }
  }
).add(new CommonAction(res,"importCertificate"){
    @Override public void actionPerformed(    ActionEvent e){
    }
  }
).get()).build();
  root.add(toolbar,BorderLayout.NORTH);
  toolbar.add(Box.createHorizontalGlue());
  list=new JPanel(new VerticalFlowLayout(VerticalFlowLayout.Alignment.FILL,5));
  list.setOpaque(true);
  list.setBackground(Color.WHITE);
  list.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
  JScrollPane scrollPane=new JScrollPane(list);
  root.add(scrollPane);
  for (  Certificate cert : context().require(Storage.class).getCertificates().values()) {
    list.add(new CertificateEntry(cert));
  }
  scrollPane.getVerticalScrollBar().setUnitIncrement(SwingUtil.getLineHeight(root,3));
  scrollPane.getHorizontalScrollBar().setUnitIncrement(SwingUtil.getMWidth(root,3));
  return root;
}
 

Example 39

From project QuakeInjector, under directory /src/de/haukerehfeld/quakeinjector/gui/.

Source file: OkayCancelApplyPanel.java

  19 
vote

/** 
 * Add some components right aligned to a gridbaglayout container at a specific row, with proper borders.
 */
public static void addRow(final java.awt.Container container,final int row,final List<JComponent> components){
  container.add(Box.createHorizontalGlue(),new LeftConstraints());
  int col=1;
  for (  JComponent c : components) {
    final int col_=col;
    container.add(c,new RightConstraints(){
{
        gridx=col_;
        gridy=row;
      }
    }
);
    col++;
  }
}
 

Example 40

From project RomRaider, under directory /3rdparty/launch4j/src/net/sf/launch4j/form/.

Source file: BasicForm.java

  19 
vote

/** 
 * Adds fill components to empty cells in the first row and first column of the grid. This ensures that the grid spacing will be the same as shown in the designer.
 * @param cols an array of column indices in the first row where fill components should be added.
 * @param rows an array of row indices in the first column where fill components should be added.
 */
void addFillComponents(Container panel,int[] cols,int[] rows){
  Dimension filler=new Dimension(10,10);
  boolean filled_cell_11=false;
  CellConstraints cc=new CellConstraints();
  if (cols.length > 0 && rows.length > 0) {
    if (cols[0] == 1 && rows[0] == 1) {
      panel.add(Box.createRigidArea(filler),cc.xy(1,1));
      filled_cell_11=true;
    }
  }
  for (int index=0; index < cols.length; index++) {
    if (cols[index] == 1 && filled_cell_11) {
      continue;
    }
    panel.add(Box.createRigidArea(filler),cc.xy(cols[index],1));
  }
  for (int index=0; index < rows.length; index++) {
    if (rows[index] == 1 && filled_cell_11) {
      continue;
    }
    panel.add(Box.createRigidArea(filler),cc.xy(1,rows[index]));
  }
}
 

Example 41

From project rpiplanner, under directory /src/rpiplanner/view/.

Source file: DegreeProgressPanel.java

  19 
vote

public void rebuildSections(){
  sections.clear();
  sectionContainer.removeAll();
  if (plan.getDegrees().size() > 0)   this.degree=plan.getDegrees().get(0);
  if (degree != null) {
    for (    String s : degree.getSectionNames()) {
      DegreeSectionDisplay dsd=new DegreeSectionDisplay(controller);
      dsd.setName(s);
      sections.put(s,dsd);
      sectionContainer.add(dsd);
    }
    sectionContainer.add(Box.createVerticalGlue());
    sectionContainer.revalidate();
  }
}
 

Example 42

From project Sagan-1, under directory /src/pro/carl/edu/sagan1/gui/viewcon/.

Source file: LandscapeJPanel.java

  19 
vote

/** 
 * Layouts the panel.
 */
public LandscapeJPanel(){
  super(new BorderLayout());
  LandscapeJPanel myself=this;
  Collection<Landscape> landscapes=Configuration.getInstance().getAllLandscapes();
  JPanel topPanel=new JPanel(new GridLayout(5 + landscapes.size(),0));
  add(topPanel,BorderLayout.NORTH);
  JPanel spacePanel=new JPanel(new GridLayout(1,0));
  spacePanel.add(Box.createVerticalGlue());
  add(spacePanel,BorderLayout.CENTER);
  helpLineLabel1=new JLabel();
  helpLineLabel2=new JLabel();
  topPanel.add(helpLineLabel1);
  topPanel.add(Box.createVerticalStrut(10));
  topPanel.add(helpLineLabel2);
  landscapeButtons=new JRadioButton[landscapes.size()];
  buttonGroup=new ButtonGroup();
  int ndx=0;
  for (  Landscape l : landscapes) {
    landscapeButtons[ndx]=new JRadioButton();
    landscapeButtons[ndx].setText(i18n(l.getKey()));
    landscapeButtons[ndx].setActionCommand(l.getKey());
    landscapeButtons[ndx].addActionListener(myself);
    landscapeButtons[ndx].setSelected(ndx == landscapes.size() - 1 ? true : false);
    buttonGroup.add(landscapeButtons[ndx]);
    topPanel.add(landscapeButtons[ndx]);
    ndx++;
  }
  if (ndx > 0) {
    selectedLandscapeKey=landscapeButtons[ndx - 1].getActionCommand();
    Landscape currentLandscape=Configuration.getInstance().getLandscape(selectedLandscapeKey);
    MasterMind.getInstance().selectLandscape(currentLandscape);
  }
  missionTextLabel=new JLabel();
  add(missionTextLabel,BorderLayout.SOUTH);
  updateGuiText();
  MasterMind.getInstance().addLanguageChangeNotificationListener(this);
}
 

Example 43

From project ScissLib, under directory /src/main/java/de/sciss/gui/.

Source file: TemporaryFocusTracker.java

  19 
vote

private void addComponent(Component comp){
  if (comp instanceof JTextComponent) {
    addTextComponent((JTextComponent)comp);
  }
 else   if ((comp instanceof JPanel) || (comp instanceof Box) || (comp instanceof JTabbedPane)) {
    addContainer((Container)comp);
  }
 else   if (comp instanceof JScrollPane) {
    addScrollPane((JScrollPane)comp);
  }
}
 

Example 44

From project skmclauncher, under directory /src/main/java/com/sk89q/mclauncher/.

Source file: AddonManagerDialog.java

  19 
vote

/** 
 * Build the UI for the active JAR.
 * @return panel
 */
private JPanel buildActiveJarSelector(){
  JPanel panel=new JPanel();
  panel.setLayout(new BoxLayout(panel,BoxLayout.X_AXIS));
  panel.add(new JLabel("Active JAR:"));
  panel.add(Box.createHorizontalStrut(5));
  jarCombo=new JComboBox();
  panel.add(jarCombo);
  panel.add(Box.createHorizontalGlue());
  JButton toolsBtn=new JButton("Tools...");
  panel.add(toolsBtn);
  toolsBtn.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      popupToolsMenu((Component)e.getSource());
    }
  }
);
  return panel;
}
 

Example 45

From project SPREAD, under directory /release/tools/launch4j/src/net/sf/launch4j/form/.

Source file: BasicForm.java

  19 
vote

/** 
 * Adds fill components to empty cells in the first row and first column of the grid. This ensures that the grid spacing will be the same as shown in the designer.
 * @param cols an array of column indices in the first row where fill components should be added.
 * @param rows an array of row indices in the first column where fill components should be added.
 */
void addFillComponents(Container panel,int[] cols,int[] rows){
  Dimension filler=new Dimension(10,10);
  boolean filled_cell_11=false;
  CellConstraints cc=new CellConstraints();
  if (cols.length > 0 && rows.length > 0) {
    if (cols[0] == 1 && rows[0] == 1) {
      panel.add(Box.createRigidArea(filler),cc.xy(1,1));
      filled_cell_11=true;
    }
  }
  for (int index=0; index < cols.length; index++) {
    if (cols[index] == 1 && filled_cell_11) {
      continue;
    }
    panel.add(Box.createRigidArea(filler),cc.xy(cols[index],1));
  }
  for (int index=0; index < rows.length; index++) {
    if (rows[index] == 1 && filled_cell_11) {
      continue;
    }
    panel.add(Box.createRigidArea(filler),cc.xy(1,rows[index]));
  }
}
 

Example 46

From project tesb-rt-se, under directory /examples/tesb/rent-a-car/app-reservation/src/main/java/org/talend/esb/client/app/.

Source file: CarRentalClientGui.java

  19 
vote

private JPanel createFindCommands(){
  JPanel searchCmd=createPanel();
  searchCmd.setLayout(new BoxLayout(searchCmd,BoxLayout.LINE_AXIS));
  searchCmd.add(Box.createRigidArea(new Dimension(380,0)));
  cmdFindCancel=new JButton(Messages.CarRentalClient_CmdCancel);
  cmdFindCancel.addActionListener(this);
  cmdFind=new JButton(Messages.CarRentalClient_CmdFind);
  cmdFind.addActionListener(this);
  searchCmd.add(cmdFindCancel);
  searchCmd.add(Box.createRigidArea(new Dimension(50,0)));
  searchCmd.add(cmdFind);
  return searchCmd;
}
 

Example 47

From project tika, under directory /tika-app/src/main/java/org/apache/tika/gui/.

Source file: TikaGUI.java

  19 
vote

private void addMenuBar(){
  JMenuBar bar=new JMenuBar();
  JMenu file=new JMenu("File");
  file.setMnemonic(KeyEvent.VK_F);
  addMenuItem(file,"Open...","openfile",KeyEvent.VK_O);
  addMenuItem(file,"Open URL...","openurl",KeyEvent.VK_U);
  file.addSeparator();
  addMenuItem(file,"Exit","exit",KeyEvent.VK_X);
  bar.add(file);
  JMenu view=new JMenu("View");
  view.setMnemonic(KeyEvent.VK_V);
  addMenuItem(view,"Metadata","metadata",KeyEvent.VK_M);
  addMenuItem(view,"Formatted text","html",KeyEvent.VK_F);
  addMenuItem(view,"Plain text","text",KeyEvent.VK_P);
  addMenuItem(view,"Main content","main",KeyEvent.VK_C);
  addMenuItem(view,"Structured text","xhtml",KeyEvent.VK_S);
  bar.add(view);
  bar.add(Box.createHorizontalGlue());
  JMenu help=new JMenu("Help");
  help.setMnemonic(KeyEvent.VK_H);
  addMenuItem(help,"About Tika","about",KeyEvent.VK_A);
  bar.add(help);
  setJMenuBar(bar);
}
 

Example 48

From project TransFile, under directory /src/net/sourceforge/transfile/ui/swing/.

Source file: OperationListComponent.java

  19 
vote

public OperationListComponent(){
  super(BoxLayout.Y_AXIS);
  this.selectionModel=new SelectionModel();
  this.setBackground(DEFAULT_BACKGROUND_COLOR);
  this.setBorder(BorderFactory.createLineBorder(OperationComponent.DEFAULT_BORDER_COLOR));
  this.add(Box.createGlue());
}
 

Example 49

From project treeGenerator, under directory /arbaro_1_9_8/src/net/sourceforge/arbaro/gui/.

Source file: Workplace.java

  19 
vote

JToolBar createToolBar(){
  toolBar=new JToolBar();
  addToolBarButton(fileNewAction);
  addToolBarButton(fileOpenAction);
  addToolBarButton(fileSaveAction);
  toolBar.add(Box.createRigidArea(new Dimension(10,10)));
  addToolBarButton(exportTreeAction);
  addToolBarButton(renderTreeAction);
  return toolBar;
}
 

Example 50

From project twistDemo, under directory /twist-libs/com.thoughtworks.webdriver.recorder_1.0.0.11288/sahi/src/net/sf/sahi/ui/.

Source file: Dashboard.java

  19 
vote

private void buildUI(){
  masterPanel=new JPanel();
  masterPanel.setBackground(new Color(255,255,255));
  masterPanel.add(Box.createRigidArea(new Dimension(120,5)));
  masterPanel.add(getBrowserButtons());
  masterPanel.add(Box.createRigidArea(new Dimension(120,15)));
  masterPanel.add(getLogo());
  masterPanel.add(Box.createRigidArea(new Dimension(120,15)));
  masterPanel.add(getLinksPanel1());
  masterPanel.add(Box.createRigidArea(new Dimension(120,2)));
  masterPanel.add(getLinksPanel2());
  masterPanel.add(Box.createRigidArea(new Dimension(120,2)));
  masterPanel.add(getLinksPanel3());
  add(masterPanel);
}
 

Example 51

From project upm-swing, under directory /src/com/_17od/upm/gui/.

Source file: AboutDialog.java

  19 
vote

public AboutDialog(JFrame frame){
  super(frame,Translator.translate("aboutUPM"),true);
  String version=AboutDialog.class.getPackage().getImplementationVersion();
  if (version == null) {
    version="<version unknown>";
  }
  JPanel panel=new JPanel();
  panel.setLayout(new BoxLayout(panel,BoxLayout.PAGE_AXIS));
  JTextArea jTextArea=new JTextArea();
  StringBuffer aboutText=new StringBuffer();
  aboutText.append("Universal Password Manager\n");
  aboutText.append(version);
  aboutText.append("\n\n");
  aboutText.append("Copyright \u00a9 2005-2011 Adrian Smith & Contributors\n\n");
  aboutText.append("[email protected]\n");
  aboutText.append("http://upm.sourceforge.net");
  jTextArea.setText(aboutText.toString());
  jTextArea.setAlignmentX(Component.CENTER_ALIGNMENT);
  jTextArea.setEditable(false);
  jTextArea.setFont(new Font("Tahoma",Font.PLAIN,12));
  jTextArea.setBorder(BorderFactory.createEmptyBorder(8,8,8,8));
  panel.add(jTextArea);
  panel.add(new JSeparator());
  panel.add(Box.createRigidArea(new Dimension(0,10)));
  JButton okButton=new JButton(Translator.translate("ok"));
  okButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      setVisible(false);
      dispose();
    }
  }
);
  okButton.setAlignmentX(Component.CENTER_ALIGNMENT);
  panel.add(okButton);
  panel.add(Box.createRigidArea(new Dimension(0,10)));
  getContentPane().add(panel);
  setResizable(false);
}
 

Example 52

From project verdandi, under directory /src/main/java/verdandi/ui/common/.

Source file: OKCancelPanel.java

  19 
vote

private void initControls(){
  btnOK.setActionCommand(CMD_OK);
  btnCancel.setActionCommand(CMD_CANCEL);
  btnOK.addActionListener(this.parent);
  btnCancel.addActionListener(this.parent);
  btnOK.setMnemonic(KeyEvent.VK_O);
  btnCancel.setMnemonic(KeyEvent.VK_R);
  this.setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
  this.add(Box.createHorizontalGlue());
  this.add(btnOK);
  this.add(Box.createHorizontalStrut(5));
  this.add(btnCancel);
  this.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
}