Java Code Examples for javax.swing.BorderFactory

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 addis, under directory /application/src/main/java/org/drugis/addis/gui/.

Source file: AddisWindow.java

  15 
vote

private void initToolbar(){
  JToolBar toolbar=new JToolBar();
  toolbar.setFloatable(false);
  toolbar.setLayout(new BorderLayout());
  ButtonBarBuilder2 builder=new ButtonBarBuilder2();
  for (  EntityCategory cat : getDomain().getCategories()) {
    CategoryKnowledge knowledge=CategoryKnowledgeFactory.getCategoryKnowledge(cat);
    if (knowledge.isToolbarCategory()) {
      builder.addButton(createToolbarButton(knowledge));
    }
  }
  toolbar.add(builder.getPanel(),BorderLayout.CENTER);
  toolbar.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  add(toolbar,BorderLayout.NORTH);
}
 

Example 2

From project alg-vis, under directory /src/algvis/gui/.

Source file: VisPanel.java

  15 
vote

private JPanel initScreen(){
  JPanel screenP=new JPanel();
  screenP.setLayout(new BorderLayout());
  screen=new Screen(){
    private static final long serialVersionUID=2196788670749006364L;
    @Override public Dimension getMaximumSize(){
      return new Dimension(Integer.MAX_VALUE,Integer.MAX_VALUE);
    }
    @Override public Dimension getPreferredSize(){
      return new Dimension(550,400);
    }
    @Override public Dimension getMinimumSize(){
      return new Dimension(550,400);
    }
  }
;
  screenP.add(screen,BorderLayout.CENTER);
  border=BorderFactory.createTitledBorder("");
  border.setTitleJustification(TitledBorder.CENTER);
  border.setTitleFont(new Font("Sans-serif",Font.ITALIC,12));
  Languages.addListener(this);
  screenP.setBorder(BorderFactory.createCompoundBorder(border,BorderFactory.createEmptyBorder(0,5,5,5)));
  return screenP;
}
 

Example 3

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

Source file: Installer.java

  15 
vote

@Override public void restored(){
  WindowManager.getDefault().invokeWhenUIReady(new Runnable(){
    @Override public void run(){
      Case.invokeStartupDialog();
    }
  }
);
  Logger logger=Logger.getLogger(Installer.class.getName());
  UIManager.put("ViewTabDisplayerUI","org.sleuthkit.autopsy.corecomponents.NoTabsTabDisplayerUI");
  UIManager.put(DefaultTabbedContainerUI.KEY_VIEW_CONTENT_BORDER,BorderFactory.createEmptyBorder());
  UIManager.put("TabbedPane.contentBorderInsets",new Insets(0,0,0,0));
}
 

Example 4

From project beam-meris-icol, under directory /src/main/java/org/esa/beam/meris/icol/ui/.

Source file: IcolForm.java

  15 
vote

private JPanel createRhoToaBandSelectionPanel(){
  TableLayout layout=new TableLayout(1);
  layout.setTableAnchor(TableLayout.Anchor.WEST);
  layout.setTableFill(TableLayout.Fill.HORIZONTAL);
  layout.setTableWeightX(1);
  layout.setTablePadding(2,2);
  rhoToaRayleigh=new JCheckBox("TOA reflectances corrected for AE rayleigh (rho_toa_AERC)");
  rhoToaAerosol=new JCheckBox("TOA reflectances corrected for AE rayleigh and AE aerosol (rho_toa_AEAC)");
  aeRayleigh=new JCheckBox("AE rayleigh correction term (rho_aeRay)");
  aeAerosol=new JCheckBox("AE aerosol correction term (rho_aeAer)");
  alphaAot=new JCheckBox("alpha + aot");
  JPanel panel=new JPanel(layout);
  panel.setBorder(BorderFactory.createTitledBorder("RhoToa Product"));
  panel.add(new JLabel("Bands included in the rhoToa product:"));
  panel.add(rhoToaRayleigh);
  panel.add(rhoToaAerosol);
  panel.add(aeRayleigh);
  panel.add(aeAerosol);
  panel.add(alphaAot);
  return panel;
}
 

Example 5

From project beanmill_1, under directory /src/main/java/com/traxel/lumbermill/event/.

Source file: EventListenerStatus.java

  15 
vote

/** 
 * Creates a new EventListenerStatus object.
 * @param listener  DOCUMENT ME!
 */
public EventListenerStatus(final EventListener listener){
  setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
  setBorder(BorderFactory.createEmptyBorder(4,4,4,4));
  this.listener=listener;
  txtStatus=new JTextField(10);
  txtType=new JTextField(5);
  txtHost=new JTextField(10);
  txtPort=new JTextField(5);
  lblStatus=new JLabel("Listener Status: ",JLabel.TRAILING);
  lblType=new JLabel("  Type: ",JLabel.TRAILING);
  lblHost=new JLabel("  Host: ",JLabel.TRAILING);
  lblPort=new JLabel("  Port: ",JLabel.TRAILING);
  lblStatus.setLabelFor(txtStatus);
  lblType.setLabelFor(txtType);
  lblHost.setLabelFor(txtHost);
  lblPort.setLabelFor(txtPort);
  add(lblStatus);
  add(txtStatus);
  add(lblType);
  add(txtType);
  add(lblHost);
  add(txtHost);
  add(lblPort);
  add(txtPort);
  txtStatus.setEditable(false);
  txtType.setEditable(false);
  txtHost.setEditable(false);
  txtPort.setEditable(false);
  if (listener != null) {
    txtStatus.setText(listener.getStatus());
    txtType.setText(listener.getType());
    txtHost.setText(listener.getHost());
    txtPort.setText(listener.getPortString());
    listener.addPropertyListener(this);
  }
}
 

Example 6

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

Source file: FilePanel.java

  15 
vote

public FilePanel(Wallet w){
  super(w);
  this.setLayout(new BorderLayout());
  this.setBackground(Color.WHITE);
  this.add(createHeaderPanel("file_small.png","File"),BorderLayout.NORTH);
  SubPanel subPanel=new SubPanel();
  subPanel.setLayout(new CardLayout());
  subPanel.setBorder(BorderFactory.createMatteBorder(1,0,0,0,Color.DARK_GRAY));
  SubPanel newWalletPanel=new SubPanel("Create a New Wallet");
  subPanel.add("New Wallet",newWalletPanel);
  SubPanel editWalletPanel=new SubPanel("Edit a Wallet");
  subPanel.add("Edit Wallet",editWalletPanel);
  SubPanel loadWalletPanel=new SubPanel("Load a Wallet");
  subPanel.add("Load Wallet",loadWalletPanel);
  SubPanel saveWalletPanel=new SubPanel("Save a Wallet");
  subPanel.add("Save Wallet",saveWalletPanel);
  JPanel sidePanel=createSidePanel(this,subPanel,"Header","New Wallet","Edit Wallet","Load Wallet","Save Wallet");
  this.add(sidePanel,BorderLayout.WEST);
  this.add(subPanel);
  currentSubPanel=newWalletPanel;
}
 

Example 7

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

Source file: BMachHelpDialog.java

  15 
vote

/** 
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked") private void initComponents(){
  jPanel1=new javax.swing.JPanel();
  jButton1=new javax.swing.JButton();
  jPanel2=new javax.swing.JPanel();
  jScrollPane1=new javax.swing.JScrollPane();
  jEditorPane1=new javax.swing.JEditorPane();
  setTitle("BMach - Help Contents");
  jButton1.setText("Close");
  jButton1.addActionListener(new java.awt.event.ActionListener(){
    public void actionPerformed(    java.awt.event.ActionEvent evt){
      jButton1ActionPerformed(evt);
    }
  }
);
  jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
  jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2,javax.swing.BoxLayout.LINE_AXIS));
  jScrollPane1.setBackground(new java.awt.Color(255,255,255));
  jEditorPane1.setBackground(new java.awt.Color(255,255,255));
  jEditorPane1.setContentType("text/html");
  jEditorPane1.setEditable(false);
  jScrollPane1.setViewportView(jEditorPane1);
  jPanel2.add(jScrollPane1);
  javax.swing.GroupLayout jPanel1Layout=new javax.swing.GroupLayout(jPanel1);
  jPanel1.setLayout(jPanel1Layout);
  jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jButton1,javax.swing.GroupLayout.Alignment.TRAILING,javax.swing.GroupLayout.PREFERRED_SIZE,118,javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jPanel2,javax.swing.GroupLayout.DEFAULT_SIZE,766,Short.MAX_VALUE)).addContainerGap()));
  jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING,jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(jPanel2,javax.swing.GroupLayout.DEFAULT_SIZE,414,Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton1).addContainerGap()));
  javax.swing.GroupLayout layout=new javax.swing.GroupLayout(getContentPane());
  getContentPane().setLayout(layout);
  layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel1,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE));
  layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel1,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE));
  pack();
}
 

Example 8

From project Calendar-Application, under directory /com/toedter/calendar/demo/.

Source file: JCalendarDemo.java

  15 
vote

/** 
 * Initializes the applet.
 */
public void init(){
  initializeLookAndFeels();
  beans=new JComponent[6];
  beans[0]=new DateChooserPanel();
  beans[1]=new JCalendar();
  beans[2]=new JDayChooser();
  beans[3]=new JMonthChooser();
  beans[4]=new JYearChooser();
  beans[5]=new JSpinField();
  ((JSpinField)beans[5]).adjustWidthToMaximumValue();
  ((JYearChooser)beans[4]).setMaximum(((JSpinField)beans[5]).getMaximum());
  ((JYearChooser)beans[4]).adjustWidthToMaximumValue();
  getContentPane().setLayout(new BorderLayout());
  setJMenuBar(createMenuBar());
  toolBar=createToolBar();
  getContentPane().add(toolBar,BorderLayout.NORTH);
  splitPane=new JSplitPane(JSplitPane.VERTICAL_SPLIT);
  splitPane.setBorder(BorderFactory.createLineBorder(Color.GRAY));
  splitPane.setDividerSize(4);
  splitPane.setDividerLocation(240);
  BasicSplitPaneDivider divider=((BasicSplitPaneUI)splitPane.getUI()).getDivider();
  if (divider != null) {
    divider.setBorder(null);
  }
  propertyPanel=new JPanel();
  componentPanel=new JPanel();
  URL iconURL=beans[0].getClass().getResource("images/" + beans[0].getName() + "Color16.gif");
  ImageIcon icon=new ImageIcon(iconURL);
  propertyTitlePanel=new JTitlePanel("Properties",null,propertyPanel,BorderFactory.createEmptyBorder(4,4,4,4));
  componentTitlePanel=new JTitlePanel("Component",icon,componentPanel,BorderFactory.createEmptyBorder(4,4,0,4));
  splitPane.setBottomComponent(propertyTitlePanel);
  splitPane.setTopComponent(componentTitlePanel);
  installBean(beans[0]);
  getContentPane().add(splitPane,BorderLayout.CENTER);
}
 

Example 9

From project ceres, under directory /ceres-ui/src/main/java/com/bc/ceres/swing/update/.

Source file: InfoPane.java

  15 
vote

private void initUi(){
  setLayout(new BorderLayout());
  infoPanel=new JEditorPane("text/html",null);
  infoPanel.setEditable(false);
  infoPanel.addHyperlinkListener(new HyperlinkListener(){
    public void hyperlinkUpdate(    HyperlinkEvent e){
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        try {
          Desktop.getDesktop().browse(e.getURL().toURI());
        }
 catch (        Exception e1) {
          JOptionPane.showMessageDialog(InfoPane.this,"Failed to open URL:\n" + e.getURL() + ":\n"+ e1.getMessage(),"Error",JOptionPane.ERROR_MESSAGE);
        }
      }
    }
  }
);
  infoPanelScrollPane=new JScrollPane(infoPanel);
  setBorder(BorderFactory.createTitledBorder("Module Information"));
  add(infoPanelScrollPane,BorderLayout.CENTER);
}
 

Example 10

From project ChkBugReport, under directory /src/com/sonyericsson/chkbugreport/.

Source file: Gui.java

  15 
vote

public Gui(Main main){
  super("ChkBugReport - (C) 2012 Sony-Ericsson");
  mMain=main;
  JTabbedPane tabs=new JTabbedPane();
  setContentPane(tabs);
  JPanel runPanel=new JPanel(new BorderLayout());
  tabs.addTab("Run",runPanel);
  JPanel runTB=new JPanel();
  runPanel.add(runTB,BorderLayout.NORTH);
  mBtnAdb=new JButton("Fetch from device");
  mBtnAdb.setEnabled(false);
  runTB.add(mBtnAdb);
  mDropArea=new JLabel("Drop a bugreport file here!",JLabel.CENTER);
  runPanel.add(mDropArea,BorderLayout.CENTER);
  mDropArea.setBorder(BorderFactory.createLoweredBevelBorder());
  mDropArea.setTransferHandler(new MyTransferHandler());
  mStatus=new JLabel("Ready.");
  runPanel.add(mStatus,BorderLayout.SOUTH);
  mAdbExt=mMain.findExtension("AdbExtension");
  if (mAdbExt != null) {
    mBtnAdb.setEnabled(true);
    mBtnAdb.addActionListener(this);
  }
  JPanel settingsPanel=new JPanel();
  settingsPanel.setLayout(new BoxLayout(settingsPanel,BoxLayout.Y_AXIS));
  tabs.addTab("Settings",settingsPanel);
  buildSettings(settingsPanel);
  setSize(640,480);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  setLocationRelativeTo(null);
}
 

Example 11

From project Cinch, under directory /example/com/palantir/ptoss/cinch/example/dynamic/.

Source file: DynamicControls.java

  15 
vote

private void initializeInterface(){
  JPanel toPanel=new JPanel(new BorderLayout());
  toPanel.add(new JLabel("Count"),BorderLayout.WEST);
  slider.setPaintLabels(true);
  slider.setLabelTable(slider.createStandardLabels(1));
  slider.setSnapToTicks(true);
  toPanel.add(slider,BorderLayout.CENTER);
  panel.setLayout(new BorderLayout());
  panel.add(toPanel,BorderLayout.NORTH);
  checkboxPanel.setLayout(new BoxLayout(checkboxPanel,BoxLayout.Y_AXIS));
  checkboxPanel.setPreferredSize(new Dimension(200,300));
  panel.add(checkboxPanel,BorderLayout.CENTER);
  panel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
}
 

Example 12

From project codjo-broadcast, under directory /codjo-broadcast-gui/src/main/java/net/codjo/broadcast/gui/.

Source file: BroadcastFileContentsDetailWindow.java

  15 
vote

private void initGui() throws Exception {
  this.setResizable(true);
  this.getContentPane().setBackground(UIManager.getColor("Panel.background"));
  this.setPreferredSize(new Dimension(430,430));
  this.getContentPane().setLayout(borderLayout1);
  mainPanel.setLayout(gridBagLayout3);
  columnPanel.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(142,142,142)),""));
  columnPanel.setLayout(gridBagLayout2);
  columnSeparator.setMaxTextLength(2);
  sectionPanel.setLayout(gridBagLayout1);
  sectionPosition.setColumns(0);
  headerPanel.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(134,134,134)),""));
  headerPanel.setLayout(new BorderLayout());
  headerPanel.add(headerScrollPane,BorderLayout.CENTER);
  dataSource.addDataSourceListener(new net.codjo.mad.gui.request.event.DataSourceAdapter(){
    @Override public void saveEvent(    DataSourceEvent event){
      dataSourceSaveEvent();
    }
  }
);
  sectionTabPanel.setName("tabPanel");
  this.getContentPane().add(sectionTabPanel,BorderLayout.CENTER);
  this.getContentPane().add(buttonPanelLogic.getGui(),BorderLayout.SOUTH);
  sectionTabPanel.add(mainPanel,"Section");
  columnPanel.add(separatorLabel,new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(0,5,5,0),0,0));
  columnPanel.add(columnSeparator,new GridBagConstraints(1,0,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(0,5,5,0),51,0));
  columnPanel.add(columnHeader,new GridBagConstraints(2,0,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,18,5,165),0,0));
  sectionPanel.add(sectionNameLabel,new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(10,5,0,12),8,0));
  sectionPanel.add(sectionId,new GridBagConstraints(1,0,2,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(10,5,0,10),181,0));
  sectionPanel.add(positionLabel,new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(10,5,0,0),0,0));
  sectionPanel.add(sectionPosition,new GridBagConstraints(1,1,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(10,5,0,0),30,0));
  sectionPanel.add(sectionHeader,new GridBagConstraints(2,1,1,1,0.0,0.0,GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(10,92,0,10),0,0));
  sectionPanel.add(headerPanel,new GridBagConstraints(0,2,3,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(10,5,5,5),0,0));
  mainPanel.add(columnPanel,new GridBagConstraints(0,1,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,9),-5,0));
  headerScrollPane.getViewport().add(sectionHeaderText,null);
  mainPanel.add(sectionPanel,new GridBagConstraints(0,0,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,9),4,54));
}
 

Example 13

From project codjo-control, under directory /codjo-control-gui/src/main/java/net/codjo/control/gui/plugin/.

Source file: DefaultQuarantineWindow.java

  15 
vote

private void initLayout(){
  waitingPanel=new WaitingPanel(translate("DefaultQuarantineWindow.waitingPanel",guiContext));
  setGlassPane(waitingPanel);
  JScrollPane scrollPane=new JScrollPane();
  scrollPane.getViewport().add(requestTable,null);
  JPanel mainPanel=new JPanel(new BorderLayout());
  mainPanel.add(scrollPane,BorderLayout.CENTER);
  toolBar=new RequestToolBar();
  toolBar.setBorder(BorderFactory.createEtchedBorder());
  JPanel bottomPanel=new JPanel(new BorderLayout());
  bottomPanel.add(toolBar,BorderLayout.CENTER);
  filterPanel=new QuarantineFilterPanel(requestTable);
  filterPanel.setWithSearchButton(false);
  filterPanel.setPostponedLoad(true);
  filterPanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(134,134,134)),translate("DefaultQuarantineWindow.filterPanel.title",guiContext)));
  this.getContentPane().setLayout(new BorderLayout());
  this.getContentPane().add(mainPanel,BorderLayout.CENTER);
  this.getContentPane().add(bottomPanel,BorderLayout.SOUTH);
  this.getContentPane().add(filterPanel,BorderLayout.NORTH);
  final WindowData window=guiData.getWindow();
  setPreferredSize(new Dimension(window.getWindowWidth(),window.getWindowHeight()));
}
 

Example 14

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

Source file: AbstractDetailWindow.java

  15 
vote

private void addFormPanels(){
  setBackground(UIManager.getColor("Panel.background"));
  if (pageOrder.size() > 1) {
    getContentPane().add(mainTabbedPane,BorderLayout.CENTER);
    for (    String pageName : pageOrder) {
      mainTabbedPane.addTab(pageName,mainPanelList.get(pageName));
    }
  }
 else   if (pageOrder.size() == 1) {
    LabelledItemPanel panel=mainPanelList.get(pageOrder.get(0));
    panel.setBorder(BorderFactory.createEtchedBorder());
    getContentPane().add(panel,BorderLayout.CENTER);
  }
  getContentPane().add(buttonPanelLogic.getGui(),BorderLayout.SOUTH);
}
 

Example 15

From project codjo-imports, under directory /codjo-imports-gui/src/main/java/net/codjo/imports/gui/.

Source file: ImportWindow.java

  15 
vote

private void jbInit(){
  TitledBorder titledBorder1=new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(134,134,134)),"Fichiers");
  TitledBorder titledBorder2=new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(134,134,134)),"Sections");
  this.getContentPane().setLayout(borderLayout3);
  filesPanel.setLayout(borderLayout1);
  this.setClosable(true);
  this.setResizable(true);
  this.setIconifiable(true);
  this.setMaximizable(true);
  this.setTitle("Fichiers / Sections");
  this.setPreferredSize(new Dimension(500,500));
  sectionsPanel.setLayout(borderLayout2);
  filesPanel.setBorder(titledBorder1);
  filesPanel.setMinimumSize(new Dimension(100,100));
  filesPanel.setPreferredSize(new Dimension(300,300));
  sectionsPanel.setBorder(titledBorder2);
  sectionsPanel.setMinimumSize(new Dimension(100,100));
  sectionsPanel.setPreferredSize(new Dimension(300,300));
  filesPanel.add(scrollPane,BorderLayout.CENTER);
  filesPanel.add(filesToolBar,BorderLayout.SOUTH);
  sectionsPanel.add(scrollPane1,BorderLayout.CENTER);
  sectionsPanel.add(contentsToolBar,BorderLayout.SOUTH);
  scrollPane1.getViewport().add(sectionsTable,null);
  scrollPane.getViewport().add(filesTable,null);
  JSplitPane splitPane=new JSplitPane(JSplitPane.VERTICAL_SPLIT,true,filesPanel,sectionsPanel);
  splitPane.setResizeWeight(0.3);
  splitPane.setDividerLocation(200);
  this.getContentPane().add(splitPane,BorderLayout.CENTER);
}
 

Example 16

From project codjo-segmentation, under directory /codjo-segmentation-gui/src/main/java/net/codjo/segmentation/gui/results/.

Source file: ClassificationResultWindowGui.java

  15 
vote

private void jbInit() throws Exception {
  setClosable(true);
  setResizable(true);
  setIconifiable(true);
  getContentPane().setLayout(new BorderLayout());
  JScrollPane scrollPane=new JScrollPane(classificationResultTable);
  scrollPane.setPreferredSize(new Dimension(700,400));
  filterPanel.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(134,134,134)),"Filtres"));
  filterPanel.setLayout(new GridBagLayout());
  filterPanel.add(new JLabel("Axe"),new GridBagConstraints(0,0,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(0,10,0,0),0,0));
  filterPanel.add(axeFilter,new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(2,10,10,0),0,0));
  filterPanel.add(new JLabel("Anomalie"),new GridBagConstraints(1,0,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(0,10,0,0),0,0));
  filterPanel.add(anomalyFilter,new GridBagConstraints(1,1,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(2,10,10,10),0,0));
  classificationResultToolBar.init(guiContext,classificationResultTable);
  this.getContentPane().add(scrollPane,BorderLayout.CENTER);
  classificationResultToolBar.setHasExcelButton(true);
  this.getContentPane().add(classificationResultToolBar,BorderLayout.SOUTH);
  this.getContentPane().add(filterPanel,BorderLayout.NORTH);
  axeFilter.setPreferredSize(new Dimension(200,21));
}
 

Example 17

From project codjo-standalone-common, under directory /src/main/java/net/codjo/gui/broadcast/.

Source file: BroadcastFileContentsDetailWindow.java

  15 
vote

private void jbInitGui() throws Exception {
  this.setResizable(true);
  this.setTitle("D?ail de la table");
  this.getContentPane().setBackground(UIManager.getColor("Panel.background"));
  this.setPreferredSize(new Dimension(430,430));
  this.getContentPane().setLayout(gridBagLayout3);
  jPanel1.setLayout(borderLayout1);
  columnPanel.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(142,142,142)),"Colonnes"));
  columnPanel.setLayout(gridBagLayout2);
  separatorLabel.setText("S?arateur");
  sectionPanel.setLayout(gridBagLayout1);
  SECTION_POSITION.setColumns(0);
  COLUMN_HEADER.setText("En t?e");
  positionLabel.setText("Position");
  SECTION_HEADER.setText("Ins?er l\'en t?e de la section");
  sectionNameLabel.setText("Nom");
  headerScrollPane.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(134,134,134)),"En-t?e"));
  this.getContentPane().add(sectionTabPanel,new GridBagConstraints(0,0,1,1,1.0,1.0,GridBagConstraints.NORTH,GridBagConstraints.BOTH,new Insets(10,5,0,5),0,0));
  this.getContentPane().add(detailButtonsPanel,new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.SOUTH,GridBagConstraints.HORIZONTAL,new Insets(10,5,5,5),0,0));
  sectionTabPanel.add(jPanel1,"Section");
  columnPanel.add(separatorLabel,new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(0,5,5,0),0,0));
  columnPanel.add(COLUMN_SEPARATOR,new GridBagConstraints(1,0,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(0,5,5,0),51,0));
  columnPanel.add(COLUMN_HEADER,new GridBagConstraints(2,0,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,18,5,165),0,0));
  sectionPanel.add(sectionNameLabel,new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(10,5,0,12),8,0));
  sectionPanel.add(SECTION_ID,new GridBagConstraints(1,0,2,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(10,5,0,10),181,0));
  sectionPanel.add(positionLabel,new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(10,5,0,0),0,0));
  sectionPanel.add(SECTION_POSITION,new GridBagConstraints(1,1,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(10,5,0,0),30,0));
  sectionPanel.add(SECTION_HEADER,new GridBagConstraints(2,1,1,1,0.0,0.0,GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(10,92,0,10),0,0));
  sectionPanel.add(headerScrollPane,new GridBagConstraints(0,2,3,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(10,5,5,5),0,0));
  headerScrollPane.getViewport().add(SECTION_HEADER_TEXT,null);
  jPanel1.add(columnPanel,BorderLayout.SOUTH);
  jPanel1.add(sectionPanel,BorderLayout.CENTER);
}
 

Example 18

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

Source file: APanel.java

  15 
vote

/** 
 * Initializes the state of this instance.
 * @throws Exception
 */
private void jbInit() throws Exception {
  this.setLocale(Language.getLoginLanguage().getLocale());
  this.setLayout(mainLayout);
  mainLayout.setHgap(2);
  mainLayout.setVgap(2);
  if (isNested)   this.add(m_curGC,BorderLayout.CENTER);
 else {
    CPanel dummy=new CPanel();
    dummy.setLayout(new BorderLayout());
    dummy.setBorder(BorderFactory.createEmptyBorder(0,0,0,2));
    dummy.add(tabPanel,BorderLayout.CENTER);
    this.add(dummy,BorderLayout.CENTER);
  }
  this.add(statusBar,BorderLayout.SOUTH);
  this.add(northPanel,BorderLayout.NORTH);
  northPanel.setLayout(northLayout);
  northLayout.setAlignment(FlowLayout.LEFT);
  toolBar.putClientProperty("JToolBar.isRollover",Boolean.TRUE);
  toolBar.setBorderPainted(false);
  toolBar.setFloatable(false);
  northPanel.add(toolBar,null);
}
 

Example 19

From project dawn-common, under directory /org.dawb.hdf5/src/ncsa/hdf/view/.

Source file: Chart.java

  15 
vote

/** 
 * Creates and layouts GUI components.
 */
protected void createUI(){
  Window owner=getOwner();
  JPanel contentPane=(JPanel)getContentPane();
  contentPane.setLayout(new BorderLayout(5,5));
  contentPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  int w=640 + (ViewProperties.getFontSize() - 12) * 15;
  int h=400 + (ViewProperties.getFontSize() - 12) * 10;
  contentPane.setPreferredSize(new Dimension(w,h));
  contentPane.add(chartP,BorderLayout.CENTER);
  JButton button=new JButton("Close");
  button.addActionListener(this);
  button.setActionCommand("Close");
  JPanel tmp=new JPanel();
  tmp.add(button);
  contentPane.add(tmp,BorderLayout.SOUTH);
  Point l=owner.getLocation();
  l.x+=220;
  l.y+=100;
  setLocation(l);
  pack();
}
 

Example 20

From project des, under directory /daemon/lib/apache-log4j-1.2.16/src/main/java/org/apache/log4j/chainsaw/.

Source file: DetailPanel.java

  15 
vote

/** 
 * Creates a new <code>DetailPanel</code> instance.
 * @param aTable the table to listen for selections on
 * @param aModel the model backing the table
 */
DetailPanel(JTable aTable,final MyTableModel aModel){
  mModel=aModel;
  setLayout(new BorderLayout());
  setBorder(BorderFactory.createTitledBorder("Details: "));
  mDetails=new JEditorPane();
  mDetails.setEditable(false);
  mDetails.setContentType("text/html");
  add(new JScrollPane(mDetails),BorderLayout.CENTER);
  final ListSelectionModel rowSM=aTable.getSelectionModel();
  rowSM.addListSelectionListener(this);
}
 

Example 21

From project drools-planner, under directory /drools-planner-examples/src/main/java/org/drools/planner/examples/app/.

Source file: DroolsPlannerExamplesApp.java

  15 
vote

private Container createContentPane(){
  JPanel contentPane=new JPanel(new BorderLayout(10,10));
  contentPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  JLabel titleLabel=new JLabel("Which example do you want to see?",JLabel.CENTER);
  titleLabel.setFont(titleLabel.getFont().deriveFont(20.0f));
  contentPane.add(titleLabel,BorderLayout.NORTH);
  JScrollPane examplesScrollPane=new JScrollPane(createExamplesPanel());
  examplesScrollPane.getHorizontalScrollBar().setUnitIncrement(20);
  examplesScrollPane.getVerticalScrollBar().setUnitIncrement(20);
  contentPane.add(examplesScrollPane,BorderLayout.CENTER);
  contentPane.add(createDescriptionPanel(),BorderLayout.SOUTH);
  return contentPane;
}
 

Example 22

From project droolsjbpm-integration, under directory /droolsjbpm-integration-examples/src/main/java/org/drools/examples/broker/ui/.

Source file: LogPanel.java

  15 
vote

public LogPanel(){
  setLayout(new BorderLayout());
  log=new JTextArea();
  log.setEditable(false);
  JScrollPane areaScrollPane=new JScrollPane(log);
  areaScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  add(areaScrollPane,BorderLayout.CENTER);
  setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
  setPreferredSize(new Dimension(400,50));
}
 

Example 23

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

Source file: TablePanel.java

  15 
vote

private JPanel createPanel(final JTable table){
  JPanel panel=new JPanel(new FlowLayout(FlowLayout.LEFT));
  final JScrollPane sp=new JScrollPane(table);
  sp.setBorder(BorderFactory.createEmptyBorder());
  sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
  sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
  panel.add(sp);
  final ComponentAdapter scrollPaneSizer=new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      final int padding=2;
      final int margin=50;
      if (findParent() == null) {
        return;
      }
      int tablewidth=table.getPreferredSize().width + padding;
      int panelwidth=findParent().getSize().width - margin;
      int headerHeight=0;
      if (table.getTableHeader() != null) {
        headerHeight=table.getTableHeader().getHeight();
      }
      int height=table.getPreferredSize().height + sp.getHorizontalScrollBar().getHeight() + headerHeight+ padding;
      sp.setPreferredSize(new Dimension(Math.min(tablewidth,panelwidth),height));
      sp.revalidate();
    }
  }
;
  table.addComponentListener(scrollPaneSizer);
  this.addHierarchyListener(new HierarchyListener(){
    public void hierarchyChanged(    HierarchyEvent e){
      if (findParent() != null) {
        findParent().addComponentListener(scrollPaneSizer);
      }
    }
  }
);
  return panel;
}
 

Example 24

From project e4-rendering, under directory /com.toedter.e4.ui.workbench.renderers.swing/src/com/toedter/e4/ui/workbench/renderers/swing/controls/.

Source file: CTabbedPane.java

  15 
vote

public CTabbedPane(){
  toolBar.setFloatable(false);
  toolBar.setBorder(BorderFactory.createEmptyBorder());
  ImageIcon maxIcon=new ImageIcon(getClass().getResource("max.png"));
  maxButton.setIcon(maxIcon);
  ImageIcon minIcon=new ImageIcon(getClass().getResource("min.png"));
  minButton.setIcon(minIcon);
  ImageIcon restoreIcon=new ImageIcon(getClass().getResource("restore.png"));
  restoreButton.setIcon(restoreIcon);
  toolBar.add(minButton);
  toolBar.add(maxButton);
  super.add(toolBar);
  super.add(tabbedPane);
  setLayout(new CTabbedPaneLayout());
}
 

Example 25

From project eclim, under directory /org.eclim.installer/java/org/eclim/installer/step/.

Source file: EclipsePluginsStep.java

  15 
vote

/** 
 * {@inheritDoc}
 * @see org.formic.wizard.step.GuiStep#init()
 */
public Component init(){
  theme=new DesertBlue();
  stepPanel=(JPanel)super.init();
  stepPanel.setBorder(null);
  JPanel panel=new JPanel();
  panel.setLayout(new BoxLayout(panel,BoxLayout.PAGE_AXIS));
  messageLabel=new JLabel();
  messageLabel.setPreferredSize(new Dimension(25,25));
  panel.add(messageLabel);
  panel.add(stepPanel);
  panel.setBorder(BorderFactory.createEmptyBorder(25,25,10,25));
  return panel;
}
 

Example 26

From project encog-java-workbench, under directory /src/main/java/org/encog/workbench/dialogs/common/.

Source file: BuildingListField.java

  15 
vote

public int createField(JPanel panel,int x,int y,int width){
  JLabel label=createLabel();
  label.setLocation(label.getX(),y);
  this.setField(new JPanel());
  this.getField().setLocation(x,y);
  this.getField().setSize(width,this.height);
  panel.add(createLabel());
  panel.add(this.getField());
  this.model=new DefaultListModel();
  this.getField().setBorder(BorderFactory.createLineBorder(Color.BLACK));
  this.getField().setLayout(new BorderLayout());
  JScrollPane scroll=new JScrollPane(this.list=new JList(this.model));
  this.getField().add(scroll,BorderLayout.CENTER);
  JPanel buttons=new JPanel();
  this.getField().add(buttons,BorderLayout.SOUTH);
  buttons.setLayout(new GridLayout(1,4));
  buttons.add(this.btnAdd=new JButton("Add"));
  buttons.add(this.btnDelete=new JButton("Remove"));
  buttons.add(this.btnEdit=new JButton("Edit"));
  this.btnAdd.addActionListener(this);
  this.btnEdit.addActionListener(this);
  this.btnDelete.addActionListener(this);
  y+=100;
  return y;
}
 

Example 27

From project FBReaderJ, under directory /obsolete/swing/src/org/geometerplus/zlibrary/ui/swing/dialogs/.

Source file: ZLSwingDialogContent.java

  15 
vote

protected ZLSwingDialogContent(ZLResource resource){
  super(resource);
  myContentPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
  myContentPanel.setLayout(myLayout);
  myConstraints.fill=GridBagConstraints.HORIZONTAL;
  myConstraints.anchor=GridBagConstraints.WEST;
  myConstraints.gridx=0;
  myConstraints.gridy=0;
  myConstraints.insets=new Insets(5,5,0,5);
  myConstraints.weightx=1;
  myConstraints.ipady=0;
}
 

Example 28

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

Source file: InstallStep.java

  15 
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 29

From project freemind, under directory /freemind/accessories/plugins/time/.

Source file: JCalendar.java

  15 
vote

/** 
 * JCalendar constructor with month spinner parameter.
 * @param date the date
 * @param locale the locale
 * @param monthSpinner false, if no month spinner should be used
 * @param weekOfYearVisible true, if weeks of year shall be visible
 */
public JCalendar(Date date,Locale locale,boolean monthSpinner,boolean weekOfYearVisible){
  setName("JCalendar");
  dayChooser=null;
  monthChooser=null;
  yearChooser=null;
  this.weekOfYearVisible=weekOfYearVisible;
  this.locale=locale;
  if (locale == null) {
    this.locale=Locale.getDefault();
  }
  calendar=Calendar.getInstance();
  setLayout(new BorderLayout());
  monthYearPanel=new JPanel();
  monthYearPanel.setLayout(new BorderLayout());
  monthChooser=new JMonthChooser(monthSpinner);
  yearChooser=new JYearChooser();
  monthChooser.setYearChooser(yearChooser);
  monthYearPanel.add(monthChooser,BorderLayout.WEST);
  monthYearPanel.add(yearChooser,BorderLayout.CENTER);
  monthYearPanel.setBorder(BorderFactory.createEmptyBorder());
  dayChooser=new JDayChooser(weekOfYearVisible);
  dayChooser.addPropertyChangeListener(this);
  monthChooser.setDayChooser(dayChooser);
  monthChooser.addPropertyChangeListener(this);
  yearChooser.setDayChooser(dayChooser);
  yearChooser.addPropertyChangeListener(this);
  dayChooser.setYearChooser(yearChooser);
  dayChooser.setMonthChooser(monthChooser);
  add(monthYearPanel,BorderLayout.NORTH);
  add(dayChooser,BorderLayout.CENTER);
  if (date != null) {
    calendar.setTime(date);
  }
  initialized=true;
  setCalendar(calendar);
}
 

Example 30

From project gitblit, under directory /src/com/gitblit/client/.

Source file: ClosableTabComponent.java

  15 
vote

public ClosableTabComponent(String title,ImageIcon icon,JTabbedPane pane,CloseTabListener closeListener){
  super(new FlowLayout(FlowLayout.LEFT,0,0));
  this.closeListener=closeListener;
  if (pane == null) {
    throw new NullPointerException("TabbedPane is null");
  }
  this.pane=pane;
  setOpaque(false);
  label=new JLabel(title);
  if (icon != null) {
    label.setIcon(icon);
  }
  add(label);
  label.setBorder(BorderFactory.createEmptyBorder(0,0,0,5));
  add(button);
  setBorder(BorderFactory.createEmptyBorder(2,0,0,0));
}
 

Example 31

From project glg2d, under directory /src/test/java/glg2d/.

Source file: UIDemo.java

  15 
vote

JComponent createBorderComponent(){
  JPanel panel=new JPanel();
  JLabel label=new JLabel("no border");
  panel.add(label);
  label=new JLabel("lowered bevel border");
  label.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
  panel.add(label);
  label=new JLabel("raised bevel border");
  label.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
  panel.add(label);
  label=new JLabel("5px empty border");
  label.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  panel.add(label);
  label=new JLabel("raised etched border");
  label.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
  panel.add(label);
  label=new JLabel("lowered etched border");
  label.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
  panel.add(label);
  label=new JLabel("line border");
  label.setBorder(BorderFactory.createLineBorder(Color.blue,3));
  panel.add(label);
  label=new JLabel("title border");
  label.setBorder(BorderFactory.createTitledBorder("Title"));
  panel.add(label);
  label=new JLabel("compound border");
  label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(),BorderFactory.createTitledBorder("Title")));
  panel.add(label);
  return panel;
}
 

Example 32

From project Gmote, under directory /gmoteserver/src/org/gmote/server/.

Source file: MediaPathChooserUi.java

  15 
vote

/** 
 * This method initializes jPanel
 * @return javax.swing.JPanel
 */
private JPanel getJPanel(){
  if (jPanel == null) {
    jPanel=new JPanel();
    jPanel.setLayout(new BorderLayout());
    JPanel test=new JPanel();
    test.setBorder(BorderFactory.createLineBorder(Color.black));
    test.setLayout(new GridLayout());
    test.add(getTxtDescription());
    jPanel.add(test,BorderLayout.NORTH);
    jPanel.add(getRightButtonPanel(),BorderLayout.EAST);
    jPanel.add(getLstPaths(),BorderLayout.CENTER);
  }
  return jPanel;
}
 

Example 33

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

Source file: ClientsPanel.java

  15 
vote

public TeamPanel(Team team){
  this.team=team;
  Color color=team.getColor();
  double gray=0.2989 * color.getRed() + 0.5870 * color.getGreen() + 0.1140 * color.getBlue();
  header.setBackground(gray > 128 ? Color.DARK_GRAY : Color.WHITE);
  setLayout(new BorderLayout());
  header.setBorder(BorderFactory.createEmptyBorder(2,5,2,5));
  header.setLayout(new BorderLayout(4,4));
  title=new JLabel(team.getName());
  title.setForeground(color);
  title.setFont(getFont().deriveFont(Font.BOLD,14));
  title.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
  score.setOpaque(false);
  score.setForeground(color);
  score.setFont(getFont().deriveFont(Font.BOLD,14));
  score.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
  score.setHorizontalAlignment(JLabel.RIGHT);
  header.add(title,BorderLayout.CENTER);
  header.add(score,BorderLayout.EAST);
  add(header,BorderLayout.NORTH);
  add(new JScrollPane(clientPanel),BorderLayout.CENTER);
  team.addListener(this);
}
 

Example 34

From project gs-tool, under directory /src/org/graphstream/tool/gui/.

Source file: LabelOptions.java

  15 
vote

public LabelOptions(JComponent icon,Class<T> options){
  setOpaque(false);
  setLayout(new GridBagLayout());
  setBorder(BorderFactory.createLineBorder(Color.RED));
  GridBagConstraints c=new GridBagConstraints();
  optionsBox=new JComboBox(options.getEnumConstants());
  optionsBox.setBorder(null);
  optionsBox.setFont(Resources.getRegularFont(11.0f));
  optionsBox.setPreferredSize(new Dimension(75,20));
  c.gridwidth=1;
  add(icon,c);
  c.gridwidth=1;
  c.insets=new Insets(0,5,0,0);
  c.fill=GridBagConstraints.HORIZONTAL;
  c.weightx=1.0;
  add(optionsBox,c);
  optionsBox.setVisible(false);
  icon.addMouseListener(this);
}
 

Example 35

From project Holo-Edit, under directory /holoedit/gui/.

Source file: DynamicTree.java

  15 
vote

public DynamicTree(String s,boolean allowMultipleSelection){
  super(new GridLayout(1,0));
  rootNode=new DefaultMutableTreeNode(s);
  treeModel=new DefaultTreeModel(rootNode);
  treeModel.addTreeModelListener(new MyTreeModelListener());
  tree=new JTree(treeModel);
  tree.setCellRenderer(new IconNodeRenderer());
  tree.setEditable(false);
  tree.setRequestFocusEnabled(false);
  if (allowMultipleSelection == false)   tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
 else   if (allowMultipleSelection == true)   tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
  tree.setShowsRootHandles(true);
  tree.setDragEnabled(true);
  tree.setFocusable(true);
  JScrollPane scrollPane=new JScrollPane(tree);
  scrollPane.setBorder(BorderFactory.createLoweredBevelBorder());
  add(scrollPane);
}
 

Example 36

From project Hotel-Management_MINF10-HCM, under directory /HotelManagement/src/main/java/core/datechooser/.

Source file: JCalendar.java

  15 
vote

/** 
 * JCalendar constructor with month spinner parameter.
 * @param date the date
 * @param locale the locale
 * @param monthSpinner false, if no month spinner should be used
 * @param weekOfYearVisible true, if weeks of year shall be visible
 */
public JCalendar(Date date,Locale locale,boolean monthSpinner,boolean weekOfYearVisible){
  setName("JCalendar");
  dayChooser=null;
  monthChooser=null;
  yearChooser=null;
  this.weekOfYearVisible=weekOfYearVisible;
  this.locale=locale;
  if (locale == null) {
    this.locale=Locale.getDefault();
  }
  calendar=Calendar.getInstance();
  setLayout(new BorderLayout());
  monthYearPanel=new JPanel();
  monthYearPanel.setLayout(new BorderLayout());
  monthChooser=new JMonthChooser(monthSpinner);
  yearChooser=new JYearChooser();
  monthChooser.setYearChooser(yearChooser);
  monthYearPanel.add(monthChooser,BorderLayout.WEST);
  monthYearPanel.add(yearChooser,BorderLayout.CENTER);
  monthYearPanel.setBorder(BorderFactory.createEmptyBorder());
  dayChooser=new JDayChooser(weekOfYearVisible);
  dayChooser.addPropertyChangeListener(this);
  monthChooser.setDayChooser(dayChooser);
  monthChooser.addPropertyChangeListener(this);
  yearChooser.setDayChooser(dayChooser);
  yearChooser.addPropertyChangeListener(this);
  add(monthYearPanel,BorderLayout.NORTH);
  add(dayChooser,BorderLayout.CENTER);
  if (date != null) {
    calendar.setTime(date);
  }
  initialized=true;
  setCalendar(calendar);
}
 

Example 37

From project hudsontrayapp-plugin, under directory /client-common/src/main/java/org/hudson/trayapp/gui/.

Source file: ConfigurationPanel.java

  15 
vote

/** 
 * This method initializes serverPanel	
 * @return javax.swing.JPanel	
 */
private JPanel getServerPanel(){
  if (serverPanel == null) {
    serverPanel=new JPanel();
    serverPanel.setLayout(new BorderLayout());
    serverPanel.setBorder(BorderFactory.createTitledBorder(null,"Servers",TitledBorder.DEFAULT_JUSTIFICATION,TitledBorder.DEFAULT_POSITION,new Font("Dialog",Font.BOLD,12),new Color(51,51,51)));
    serverPanel.add(getSpacingPanel(),java.awt.BorderLayout.WEST);
    serverPanel.add(getServerDetailsPane(),java.awt.BorderLayout.CENTER);
  }
  return serverPanel;
}
 

Example 38

From project ib-ruby, under directory /misc/IBJts-965/java/TestJavaClient/.

Source file: AccountDlg.java

  15 
vote

public AccountDlg(JFrame parent){
  super(parent,true);
  JScrollPane acctPane=new JScrollPane(new JTable(m_acctValueModel));
  JScrollPane portPane=new JScrollPane(new JTable(m_portfolioModel));
  acctPane.setBorder(BorderFactory.createTitledBorder("Key, Value, Currency, and Account"));
  portPane.setBorder(BorderFactory.createTitledBorder("Portfolio Entries"));
  JSplitPane splitPane=new JSplitPane(JSplitPane.VERTICAL_SPLIT,acctPane,portPane);
  splitPane.setOneTouchExpandable(true);
  splitPane.setDividerLocation(240);
  splitPane.setPreferredSize(new Dimension(600,350));
  JPanel timePanel=new JPanel();
  timePanel.add(m_timeLabel);
  timePanel.add(m_updateTime);
  timePanel.add(m_close);
  m_updateTime.setEditable(false);
  m_updateTime.setHorizontalAlignment(JTextField.CENTER);
  m_updateTime.setPreferredSize(new Dimension(80,26));
  m_close.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      onClose();
    }
  }
);
  getContentPane().add(splitPane,BorderLayout.CENTER);
  getContentPane().add(timePanel,BorderLayout.SOUTH);
  setLocation(20,20);
  pack();
  reset();
}
 

Example 39

From project imageflow, under directory /src/de/danielsenff/imageflow/gui/.

Source file: GraphPanel.java

  15 
vote

/** 
 * @param panelListener
 * @param graphController
 */
public GraphPanel(final GPanelListener panelListener,final GraphController graphController){
  super(panelListener);
  setGraphController(graphController);
  this.welcomeArea=new WelcomeArea();
  JPopupMenu.setDefaultLightWeightPopupEnabled(false);
  if (!IJ.isMacintosh())   this.setBorder(BorderFactory.createLoweredBevelBorder());
  this.setDropTarget(new DropTarget(this,new GraphPanelDropHandler(this,graphController)));
}
 

Example 40

From project isohealth, under directory /Oauth/java/jmeter/jmeter/src/main/java/org/apache/jmeter/protocol/oauth/control/gui/.

Source file: OAuthConfigGui.java

  15 
vote

private void init(){
  this.setLayout(new BorderLayout());
  JPanel oauthPanel=new VerticalPanel();
  oauthPanel.setLayout(new BoxLayout(oauthPanel,BoxLayout.Y_AXIS));
  oauthPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),OAuthSamplerGui.getResString("oauth_param")));
  createConstraints();
  oauthPanel.add(getConsumerKeyPanel());
  oauthPanel.add(getConsumerSecretPanel());
  oauthPanel.add(getTokenPanel());
  this.add(oauthPanel);
}
 

Example 41

From project JaamSim, under directory /com/sandwell/JavaSimulation3D/.

Source file: GUIFrame.java

  15 
vote

public void initializeStatusBar(){
  JPanel statusBar=new JPanel();
  statusBar.setBorder(BorderFactory.createLineBorder(Color.darkGray));
  statusBar.setLayout(new FlowLayout(FlowLayout.LEFT,10,5));
  JLabel clockLabel=new JLabel("Simulation Time (hrs):");
  clockDisplay=new JLabel("------.--",JLabel.RIGHT);
  clockDisplay.setPreferredSize(new Dimension(55,16));
  clockDisplay.setForeground(new Color(1.0f,0.0f,0.0f));
  statusBar.add(clockLabel);
  statusBar.add(clockDisplay);
  progressBar=new JProgressBar(0,100);
  progressBar.setValue(0);
  progressBar.setStringPainted(true);
  statusBar.add(progressBar);
  JLabel speedUpLabel=new JLabel("Speed Up:");
  speedUpDisplay=new JLabel("------",JLabel.RIGHT);
  speedUpDisplay.setPreferredSize(new Dimension(60,16));
  speedUpDisplay.setForeground(new Color(1.0f,0.0f,0.0f));
  statusBar.add(speedUpLabel);
  statusBar.add(speedUpDisplay);
  JLabel remainingLabel=new JLabel("Time Remaining (mins):");
  remainingDisplay=new JLabel("------",JLabel.RIGHT);
  remainingDisplay.setPreferredSize(new Dimension(40,16));
  remainingDisplay.setForeground(new Color(1.0f,0.0f,0.0f));
  statusBar.add(remainingLabel);
  statusBar.add(remainingDisplay);
  locatorPos=new JLabel("(-, -, -)");
  locatorPos.setPreferredSize(new Dimension(140,16));
  locatorPos.setForeground(new Color(1.0f,0.0f,0.0f));
  locatorLabel=new JLabel("Pos:     ");
  statusBar.add(locatorLabel);
  statusBar.add(locatorPos);
  getContentPane().add(statusBar,BorderLayout.SOUTH);
}
 

Example 42

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

Source file: CurrentShapesPanel.java

  15 
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 43

From project jCAE, under directory /jcae/mesh-algos/src/org/jcae/netbeans/mesh/.

Source file: ExportGroupAction.java

  15 
vote

public ChooseUnitPanel(){
  setLayout(new GridBagLayout());
  setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  GridBagConstraints gbc=new GridBagConstraints();
  gbc.anchor=GridBagConstraints.WEST;
  add(new JLabel("Unit:"),gbc);
  gbc=new GridBagConstraints();
  gbc.gridy=1;
  add(unitCombo,gbc);
  gbc=new GridBagConstraints();
  gbc.gridy=2;
  gbc.fill=GridBagConstraints.HORIZONTAL;
  gbc.insets=new Insets(5,5,5,5);
  add(new JSeparator(),gbc);
  gbc=new GridBagConstraints();
  gbc.gridy=3;
  gbc.anchor=GridBagConstraints.WEST;
  add(new JLabel("Scale:"),gbc);
  gbc=new GridBagConstraints();
  gbc.gridy=4;
  gbc.anchor=GridBagConstraints.NORTH;
  gbc.fill=GridBagConstraints.HORIZONTAL;
  gbc.weightx=1.0;
  gbc.weighty=1.0;
  add(scaleField,gbc);
  scaleField.setFormatterFactory(DoubleFormatter.FACTORY);
}
 

Example 44

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

Source file: AboutDialog.java

  15 
vote

public void doInit(){
  String version=JCPPropertyHandler.getInstance(true).getVersion();
  String s1="JChemPaint " + version + "\n";
  s1+=GT._("An open-source editor for 2D chemical structures.");
  String s2=GT._("An OpenScience project.") + "\n";
  s2+=GT._("See 'http://jchempaint.github.com' for more information.");
  getContentPane().setLayout(new BorderLayout());
  getContentPane().setBackground(Color.white);
  JLabel label1=new JLabel();
  try {
    JCPPropertyHandler jcpph=JCPPropertyHandler.getInstance(true);
    URL url=jcpph.getResource("jcplogo" + JCPAction.imageSuffix);
    ImageIcon icon=new ImageIcon(url);
    label1=new JLabel(icon);
  }
 catch (  Exception exception) {
    logger.error("Cannot add JCP logo: " + exception.getMessage());
    logger.debug(exception);
  }
  label1.setBackground(Color.white);
  Border lb=BorderFactory.createLineBorder(Color.white,5);
  JTextArea jtf1=new JTextArea(s1);
  jtf1.setBorder(lb);
  jtf1.setEditable(false);
  JTextArea jtf2=new JTextArea(s2);
  jtf2.setEditable(false);
  jtf2.setBorder(lb);
  getContentPane().add("Center",label1);
  getContentPane().add("North",jtf1);
  getContentPane().add("South",jtf2);
  pack();
  setVisible(true);
}
 

Example 45

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

Source file: ImageCellRenderer.java

  15 
vote

/** 
 * Constructs an <code>ImageCellRenderer</code> object with no image.
 * @param icon Icon to render
 */
public ImageCellRenderer(Icon icon){
  super();
  this.icon=icon;
  setOpaque(true);
  setBorder(BorderFactory.createEmptyBorder(1,5,1,5));
}
 

Example 46

From project jgraphx, under directory /examples/com/mxgraph/examples/swing/.

Source file: CustomCanvas.java

  15 
vote

public SwingCanvas(mxGraphComponent graphComponent){
  this.graphComponent=graphComponent;
  vertexRenderer.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
  vertexRenderer.setHorizontalAlignment(JLabel.CENTER);
  vertexRenderer.setBackground(graphComponent.getBackground().darker());
  vertexRenderer.setOpaque(true);
}
 

Example 47

From project jlac, under directory /src/org/sump/analyzer/.

Source file: DiagramLabels.java

  15 
vote

/** 
 * Constructs diagram labels component.
 */
public DiagramLabels(){
  super();
  setLayout(new GridBagLayout());
  setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  JPanel modePane=new JPanel();
  modePane.setLayout(new GridBagLayout());
  modePane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Diagram Labels"),BorderFactory.createEmptyBorder(5,5,5,5)));
  labelFields=new JTextField[32];
  diagramLabels=new String[32];
  for (int col=0; col < 2; col++) {
    for (int row=0; row < 16; row++) {
      int num=16 * col + row;
      modePane.add(new JLabel("Channel " + num + ": "),createConstraints(2 * col,row,1,1,0,0));
      labelFields[num]=new JTextField(20);
      modePane.add(labelFields[num],createConstraints(2 * col + 1,row,1,1,0,0));
      diagramLabels[num]=new String();
    }
  }
  add(modePane,createConstraints(0,0,5,1,0,0));
  JButton ok=new JButton("Ok");
  ok.addActionListener(this);
  add(ok,createConstraints(0,1,1,1,0.34,0));
  JButton cancel=new JButton("Cancel");
  cancel.addActionListener(this);
  add(cancel,createConstraints(1,1,1,1,0.33,0));
  JButton clear=new JButton("Clear");
  clear.addActionListener(this);
  add(clear,createConstraints(2,1,1,1,0.33,0));
}
 

Example 48

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

Source file: AmfProxyControlGui.java

  15 
vote

private JPanel createTestPlanContentPanel(){
  httpHeaders=new JCheckBox(JMeterUtils.getResString("proxy_headers"));
  httpHeaders.setSelected(true);
  httpHeaders.addActionListener(this);
  httpHeaders.setActionCommand(ENABLE_RESTART);
  addAssertions=new JCheckBox(JMeterUtils.getResString("proxy_assertions"));
  addAssertions.setSelected(false);
  addAssertions.addActionListener(this);
  addAssertions.setActionCommand(ENABLE_RESTART);
  regexMatch=new JCheckBox(JMeterUtils.getResString("proxy_regex"));
  regexMatch.setSelected(false);
  regexMatch.addActionListener(this);
  regexMatch.setActionCommand(ENABLE_RESTART);
  addDelay=new JCheckBox(AmfResources.getResString("proxy_delay"));
  addDelay.setSelected(false);
  addDelay.addActionListener(this);
  addDelay.setActionCommand(ENABLE_RESTART);
  VerticalPanel mainPanel=new VerticalPanel();
  mainPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("proxy_test_plan_content")));
  HorizontalPanel nodeCreationPanel=new HorizontalPanel();
  nodeCreationPanel.add(httpHeaders);
  nodeCreationPanel.add(addAssertions);
  nodeCreationPanel.add(regexMatch);
  nodeCreationPanel.add(addDelay);
  HorizontalPanel targetPanel=new HorizontalPanel();
  targetPanel.add(createTargetPanel());
  targetPanel.add(createGroupingPanel());
  mainPanel.add(targetPanel);
  mainPanel.add(nodeCreationPanel);
  return mainPanel;
}
 

Example 49

From project jmeter-components, under directory /src/main/java/com/atlantbh/jmeter/plugins/hadooputilities/hdfsoperations/gui/.

Source file: HdfsOperationsGui.java

  15 
vote

public void init(){
  setLayout(new BorderLayout());
  setBorder(makeBorder());
  add(makeTitlePanel(),BorderLayout.NORTH);
  VerticalPanel panel=new VerticalPanel();
  panel.setBorder(BorderFactory.createEtchedBorder());
  nameNodeTextField=new JLabeledTextField("Namenode");
  inputFilePathTextField=new JLabeledTextField("Input file destination");
  outputFilePathTextField=new JLabeledTextField("Output destination on HDFS");
  panel.add(nameNodeTextField);
  panel.add(inputFilePathTextField);
  panel.add(outputFilePathTextField);
  add(panel,BorderLayout.CENTER);
}
 

Example 50

From project JoshEdit, under directory /org/lateralgm/joshedit/.

Source file: CompletionMenu.java

  15 
vote

public CompletionMenu(Frame owner,JoshText a,int y,int x1,int x2,int caret,Completion[] c){
  area=a;
  row=y;
  wordStart=x1;
  wordEnd=x2;
  this.caret=caret;
  completions=c;
  keyHandler=new KeyHandler();
  completionList=new JList();
  completionList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  completionList.addKeyListener(keyHandler);
  completionList.addMouseListener(new MouseAdapter(){
    @Override public void mouseClicked(    MouseEvent e){
      if (apply())       e.consume();
 else       dispose();
    }
  }
);
  scroll=new JScrollPane(completionList);
  scroll.setBorder(BorderFactory.createLineBorder(Color.BLACK));
  ph=new PopupHandler(owner,scroll);
  ph.addHideListener(new PopupHandler.HideListener(){
    @Override public void hidePerformed(    boolean wasVisible){
      dispose();
    }
  }
);
  reset();
}
 

Example 51

From project joshua, under directory /src/joshua/ui/.

Source file: StartupWindow.java

  15 
vote

public StartupWindow(String title,String author,String year,Image image,Color borderColor,int borderWidth){
  JPanel content=(JPanel)getContentPane();
  content.setBackground(Color.WHITE);
  int width=250;
  int height=100;
  Point center=GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
  setBounds(center.x - width / 2,center.y - height / 2,width,height);
  JLabel titleLabel=new JLabel(title,JLabel.CENTER);
  titleLabel.setFont(new Font("Sans-Serif",Font.BOLD,24));
  content.add(titleLabel,BorderLayout.NORTH);
  JLabel copyright=new JLabel("\u24D2 " + year + " - "+ author,JLabel.CENTER);
  copyright.setFont(new Font("Sans-Serif",Font.PLAIN,8));
  content.add(copyright,BorderLayout.SOUTH);
  if (image != null) {
    content.add(new JLabel(new ImageIcon(image)));
  }
  content.setBorder(BorderFactory.createLineBorder(borderColor,borderWidth));
  setVisible(true);
}
 

Example 52

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

Source file: ResultsCellRenderer.java

  15 
vote

public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  if (value == null || value instanceof Double && value.equals(Double.NaN)) {
    setValue("NA");
  }
 else   if (value instanceof Double) {
    setDoubleValue((Double)value);
  }
 else {
    super.setValue(value);
  }
  if (isSelected) {
    setBorder(BorderFactory.createLineBorder(Color.black,1));
  }
 else {
    setBorder(BorderFactory.createEmptyBorder());
  }
  return this;
}
 

Example 53

From project jupload, under directory /src/wjhk/jupload2/policies/.

Source file: DefaultUploadPolicy.java

  15 
vote

/** 
 * Default implementation of {@link wjhk.jupload2.policies.UploadPolicy#createTopPanel(JButton,JButton,JButton,JUploadPanel)}. IT creates a JPanel, containing the three given JButton. It creates the same panel as the original JUpload.
 * @see wjhk.jupload2.policies.UploadPolicy#createTopPanel(JButton,JButton,JButton,JUploadPanel)
 */
public JPanel createTopPanel(JButton browse,JButton remove,JButton removeAll,@SuppressWarnings("unused") JUploadPanel jUploadPanel){
  JPanel jPanel=new JPanel();
  jPanel.setLayout(new GridLayout(1,3,10,5));
  jPanel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
  jPanel.add(browse);
  jPanel.add(removeAll);
  jPanel.add(remove);
  jUploadPanel.setBorder(BorderFactory.createLineBorder(SystemColor.controlDkShadow));
  return jPanel;
}
 

Example 54

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

Source file: ProcessingEditorViewComponent.java

  15 
vote

protected void initialize(){
  JSplitPane sp=PanelFactory.createOneTouchSplitPane(JSplitPane.VERTICAL_SPLIT);
  sp.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
  ProcessingTreeViewBuilder treeBuilder=new ProcessingTreeViewBuilder(this.manager);
  sp.setTopComponent(treeBuilder.getView());
  sp.setBottomComponent(PanelFactory.createTitledPanel(new JPanel(),"PipelineView"));
  this.view=sp;
}