List of usage examples for javax.swing SwingConstants CENTER
int CENTER
To view the source code for javax.swing SwingConstants CENTER.
Click Source Link
From source file:com.sec.ose.osi.ui.frm.main.identification.codematch.table.JTableInfoForCMFolder.java
synchronized public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);//from w w w . ja va 2 s . c om if (value == null) { comp.setToolTipText(null); return comp; } comp.setToolTipText(String.valueOf(value)); if (row >= table.getRowCount()) { log.debug("row > table.getRowCount()"); return comp; } switch (column) { case TableModelForCMFolder.COL_COMPONENT_NAME: case TableModelForCMFolder.COL_LICENSE_NAME: setHorizontalAlignment(SwingConstants.LEFT); break; case TableModelForCMFolder.COL_VERSION_NAME: case TableModelForCMFolder.COL_IDENTIFIED: case TableModelForCMFolder.COL_STATUS: case TableModelForCMFolder.COL_PENDING: setHorizontalAlignment(SwingConstants.CENTER); break; } int pendingHits = 0; int identifiedHits = 0; if (table.getValueAt(row, TableModelForCMFolder.COL_PENDING) != null) { pendingHits = Tools .transStringToInteger(table.getValueAt(row, TableModelForCMFolder.COL_PENDING).toString()); } if (table.getValueAt(row, TableModelForCMFolder.COL_IDENTIFIED) != null) { identifiedHits = Tools .transStringToInteger(table.getValueAt(row, TableModelForCMFolder.COL_IDENTIFIED).toString()); } if (identifiedHits > 0 && pendingHits == 0) { comp.setFont(new Font("Arial", Font.BOLD, 12)); comp.setForeground(NORMAL_COLOR); } else if (identifiedHits == 0 && pendingHits == 0) { comp.setForeground(GRAY_COLOR); } else { comp.setForeground(NORMAL_COLOR); } return comp; }
From source file:dmh.kuebiko.view.NoteStackFrame.java
/** * Initialize the contents of the frame. The contents of this method was * generated by Window Builder Pro./*from www .ja v a 2 s . co m*/ */ private void initialize() { setTitle(buildTitle()); setBounds(100, 100, 450, 300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[] { 0, 0, 0, 0 }; gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0 }; gridBagLayout.columnWeights = new double[] { 0.0, 0.0, 1.0, Double.MIN_VALUE }; gridBagLayout.rowWeights = new double[] { 0.0, 1.0, 1.0, 1.0, 1.0, Double.MIN_VALUE }; getContentPane().setLayout(gridBagLayout); horizontalStrut = Box.createHorizontalStrut(20); horizontalStrut.setMinimumSize(new Dimension(3, 0)); horizontalStrut.setPreferredSize(new Dimension(3, 0)); horizontalStrut.setSize(new Dimension(3, 0)); GridBagConstraints gbc_horizontalStrut = new GridBagConstraints(); gbc_horizontalStrut.insets = new Insets(0, 0, 0, 0); gbc_horizontalStrut.gridx = 0; gbc_horizontalStrut.gridy = 0; getContentPane().add(horizontalStrut, gbc_horizontalStrut); GridBagConstraints gbc_stateImageLabel = new GridBagConstraints(); gbc_stateImageLabel.insets = new Insets(0, 0, 0, 0); gbc_stateImageLabel.anchor = GridBagConstraints.EAST; gbc_stateImageLabel.gridx = 1; gbc_stateImageLabel.gridy = 0; stateImageLabel.setBorder(null); stateImageLabel.setHorizontalAlignment(SwingConstants.CENTER); getContentPane().add(stateImageLabel, gbc_stateImageLabel); searchText = new JTextField(); GridBagConstraints gbc_searchText = new GridBagConstraints(); gbc_searchText.insets = new Insets(0, 0, 0, 0); gbc_searchText.fill = GridBagConstraints.HORIZONTAL; gbc_searchText.gridx = 2; gbc_searchText.gridy = 0; getContentPane().add(searchText, gbc_searchText); searchText.setColumns(10); if (SystemUtils.IS_OS_MAC_OSX) { // Make the text field look like the standard Mac OS X search // box control. searchText.putClientProperty("JTextField.variant", "search"); } splitPane = new JSplitPane(); splitPane.setBorder(null); splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); GridBagConstraints gbc_splitPane = new GridBagConstraints(); gbc_splitPane.gridwidth = 3; gbc_splitPane.gridheight = 4; gbc_splitPane.insets = new Insets(0, 0, 0, 0); gbc_splitPane.fill = GridBagConstraints.BOTH; gbc_splitPane.gridx = 0; gbc_splitPane.gridy = 1; getContentPane().add(splitPane, gbc_splitPane); notePanel = new NotePanel(); notePanel.getHuxleyUiManager().setOnTextChangeCallback(new Callback<Boolean>() { @Override public void callback(Boolean input) { toggleUnsavedChangeIndicator(input); } }); splitPane.setRightComponent(notePanel); noteTableScroll = new JScrollPane(); noteTableScroll.setMinimumSize(new Dimension(23, 100)); splitPane.setLeftComponent(noteTableScroll); noteTable = newNoteTable(); noteTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); noteTableScroll.setViewportView(noteTable); ActionObserverUtil.registerEnMass(actionMngr, observable, notePanel.getHuxleyUiManager().getTextAction(TextAction.INSERT_DATE)); insertDateMenuItem = new JMenuItem(actionMngr.getAction(InsertDynamicTextAction.class)); insertDateMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.SHIFT_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); textMenu.add(insertDateMenuItem); }
From source file:com.tiempometa.muestradatos.JProgramTags.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents ResourceBundle bundle = ResourceBundle.getBundle("com.tiempometa.muestradatos.muestradatos"); dialogPane = new JPanel(); contentPanel = new JPanel(); label1 = new JLabel(); statusLabel = new JLabel(); nextChipnumberTextField = new JTextField(); programButton = new JButton(); bibLabel = new JLabel(); label3 = new JLabel(); tidTextField = new JTextField(); label4 = new JLabel(); epcTextField = new JTextField(); label5 = new JLabel(); programmedEpcTextField = new JTextField(); scrollPane1 = new JScrollPane(); tagReadTable = new JTable(); lockCheckbox = new JCheckBox(); label2 = new JLabel(); accessPasswordTextField = new JTextField(); label6 = new JLabel(); killPasswordTextField = new JTextField(); checkBox1 = new JCheckBox(); buttonBar = new JPanel(); closeButton = new JButton(); CellConstraints cc = new CellConstraints(); // ======== this ======== setTitle(bundle.getString("JProgramTags.this.title")); setIconImage(/*from w w w . j a v a 2 s . c o m*/ new ImageIcon(getClass().getResource("/com/tiempometa/resources/tiempometa_icon_large_alpha.png")) .getImage()); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); // ======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); // ======== contentPanel ======== { contentPanel.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(12)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(86)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(73)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(71)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(68)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(97)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(17)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // ---- label1 ---- label1.setText(bundle.getString("JProgramTags.label1.text")); label1.setFont(new Font("Tahoma", Font.PLAIN, 36)); contentPanel.add(label1, cc.xywh(3, 5, 3, 1)); // ---- statusLabel ---- statusLabel.setText(bundle.getString("JProgramTags.statusLabel.text")); statusLabel.setHorizontalAlignment(SwingConstants.CENTER); statusLabel.setBackground(Color.yellow); statusLabel.setOpaque(true); statusLabel.setFont(new Font("Tahoma", Font.BOLD, 20)); contentPanel.add(statusLabel, cc.xywh(9, 3, 3, 5)); // ---- nextChipnumberTextField ---- nextChipnumberTextField.setFont(new Font("Tahoma", Font.PLAIN, 36)); contentPanel.add(nextChipnumberTextField, cc.xy(7, 5)); // ---- programButton ---- programButton.setText(bundle.getString("JProgramTags.programButton.text")); programButton.setFont(new Font("Tahoma", Font.PLAIN, 14)); programButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { programButtonActionPerformed(e); } }); contentPanel.add(programButton, cc.xywh(3, 7, 3, 1)); // ---- bibLabel ---- bibLabel.setForeground(Color.red); bibLabel.setFont(new Font("Tahoma", Font.BOLD, 36)); bibLabel.setHorizontalAlignment(SwingConstants.CENTER); contentPanel.add(bibLabel, cc.xy(11, 9)); // ---- label3 ---- label3.setText(bundle.getString("JProgramTags.label3.text")); label3.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(label3, cc.xy(7, 11)); // ---- tidTextField ---- tidTextField.setEditable(false); tidTextField.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(tidTextField, cc.xywh(9, 11, 3, 1)); // ---- label4 ---- label4.setText(bundle.getString("JProgramTags.label4.text")); label4.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(label4, cc.xy(7, 13)); // ---- epcTextField ---- epcTextField.setEditable(false); epcTextField.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(epcTextField, cc.xywh(9, 13, 3, 1)); // ---- label5 ---- label5.setText(bundle.getString("JProgramTags.label5.text")); label5.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(label5, cc.xy(7, 15)); // ---- programmedEpcTextField ---- programmedEpcTextField.setEditable(false); programmedEpcTextField.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(programmedEpcTextField, cc.xywh(9, 15, 3, 1)); // ======== scrollPane1 ======== { scrollPane1.setViewportView(tagReadTable); } contentPanel.add(scrollPane1, cc.xywh(3, 17, 9, 1)); // ---- lockCheckbox ---- lockCheckbox.setText(bundle.getString("JProgramTags.lockCheckbox.text")); lockCheckbox.setSelected(true); lockCheckbox.setFont(new Font("Tahoma", Font.PLAIN, 14)); lockCheckbox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { checkBox2ItemStateChanged(e); } }); contentPanel.add(lockCheckbox, cc.xy(3, 19)); // ---- label2 ---- label2.setText(bundle.getString("JProgramTags.label2.text")); label2.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(label2, cc.xy(5, 19)); // ---- accessPasswordTextField ---- accessPasswordTextField.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(accessPasswordTextField, cc.xy(7, 19)); // ---- label6 ---- label6.setText(bundle.getString("JProgramTags.label6.text")); label6.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(label6, cc.xy(5, 21)); // ---- killPasswordTextField ---- killPasswordTextField.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(killPasswordTextField, cc.xy(7, 21)); // ---- checkBox1 ---- checkBox1.setText(bundle.getString("JProgramTags.checkBox1.text")); checkBox1.setEnabled(false); contentPanel.add(checkBox1, cc.xy(9, 21)); } dialogPane.add(contentPanel, BorderLayout.EAST); // ======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout( new FormLayout(new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); // ---- closeButton ---- closeButton.setText("Cerrar"); closeButton.setFont(new Font("Tahoma", Font.PLAIN, 14)); closeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { closeButtonActionPerformed(e); } }); buttonBar.add(closeButton, cc.xy(2, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); setSize(700, 625); setLocationRelativeTo(getOwner()); // //GEN-END:initComponents }
From source file:com.diversityarrays.kdxplore.curate.TraitsAndInstancesPanel2.java
public TraitsAndInstancesPanel2(CurationContext cc, Font smallFont, TIStatsTableModel tistm, boolean anyInstanceNumbers, int nInvalidRules, String tAndIpanelLabel, CurationMenuProvider curationMenuProvider, Consumer<List<OutlierSelection>> outlierConsumer) { super(new BorderLayout()); this.curationContext = cc; this.outlierConsumer = outlierConsumer; this.curationMenuProvider = curationMenuProvider; this.tiStatsModel = tistm; curationContext.addPropertyChangeListener(propertyChangeListener); traitInstanceStatsTable = new TraitInstanceStatsTable(tiStatsModel); traitInstanceStatsTable.addPropertyChangeListener("rowSorter", rowSorterChangeListener); traitInstanceStatsTable.setAutoCreateRowSorter(true); traitInstanceStatsTable.addMouseListener(new MouseAdapter() { @Override//from w w w. jav a 2 s . c om public void mouseClicked(MouseEvent me) { int clickCount = me.getClickCount(); if (SwingUtilities.isRightMouseButton(me) && 1 == clickCount) { me.consume(); showContextMenu(me); } else if (SwingUtilities.isLeftMouseButton(me) && 2 == clickCount) { showTraitInstanceInfo(me); } } }); Map<String, TableColumn[]> tableColumnsByChoice = createInstanceTableColumnsByChoice(); TableColumnSelectionButton tcsb = new TableColumnSelectionButton(traitInstanceStatsTable, tableColumnsByChoice); StringCellRenderer scRenderer = new StringCellRenderer(); scRenderer.setHorizontalAlignment(SwingConstants.CENTER); statDetailRenderer.setHorizontalAlignment(SwingConstants.CENTER); traitInstanceStatsTable.setDefaultRenderer(String.class, scRenderer); Transformer<TraitInstance, String> instanceNameTransformer = new Transformer<TraitInstance, String>() { @Override public String transform(TraitInstance ti) { return curationContext.makeTraitInstanceName(ti); } }; TraitInstanceCellRenderer tiRenderer = new TraitInstanceCellRenderer( curationContext.getTraitColorProvider(), instanceNameTransformer); tiRenderer.setName("FOR-STATS-TABLE"); //$NON-NLS-1$ traitInstanceStatsTable.setDefaultRenderer(TraitInstance.class, tiRenderer); traitInstanceStatsTable.setDefaultRenderer(Comparable.class, statDetailRenderer); TableColumnModel tcm = traitInstanceStatsTable.getColumnModel(); Integer viewColumnIndex = tistm.getViewColumnIndex(); if (viewColumnIndex != null) { TableColumn viewColumn = tcm.getColumn(viewColumnIndex); viewColumn.setMaxWidth(40); viewColumn.setCellRenderer(new OptionalCheckboxRenderer("No Values")); } if (nInvalidRules <= 0) { // Hide that column! int columnIndex = tistm.getValRuleErrorColumnIndex(); columnIndex = traitInstanceStatsTable.convertColumnIndexToView(columnIndex); if (columnIndex >= 0) { TableColumn c = tcm.getColumn(columnIndex); tcm.removeColumn(c); } } TableColumn dataTypeTableColumn = traitInstanceStatsTable.getColumnModel() .getColumn(tistm.getTraitInstanceDatatypeColumnIndex()); dataTypeTableColumn.setCellRenderer(new TraitDataTypeRenderer()); Function<JTable, JScrollPane> scrollMaker = new Function<JTable, JScrollPane>() { @Override public JScrollPane apply(JTable t) { return new PromptScrollPane(t, "Select Trait in the Panel: " + tAndIpanelLabel); } }; TitledTablePanelWithResizeControls ttp = new TitledTablePanelWithResizeControls("Trait Instances", traitInstanceStatsTable, smallFont, scrollMaker); ttp.scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); ttp.scrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, tcsb); new CurationContextOptionsPopup(curationContext, ttp.separator); if (anyInstanceNumbers) { tcsb.setSelectedColumns(SimpleStatistics.GROUP_BASIC_STATS); } else { Set<Object> headerValues = new HashSet<>(); for (TableColumn tc : tableColumnsByChoice.get(SimpleStatistics.GROUP_BASIC_STATS)) { headerValues.add(tc.getHeaderValue()); } headerValues.remove(tistm.getInstanceHeading()); tcsb.initialiseSelectedColumns(new Predicate<Object>() { @Override public boolean evaluate(Object hvalue) { return headerValues.contains(hvalue); } }); } add(ttp, BorderLayout.CENTER); }
From source file:edu.harvard.i2b2.query.QueryTopPanel.java
/** This method is called from within the constructor to * initialize the form.//from ww w .jav a 2s . c o m */ private void initComponents() { jNameLabel = new javax.swing.JLabel(); jNameTextField = new javax.swing.JTextField(); jDeleteButton = new javax.swing.JButton(); jScrollPane1 = new QueryConceptTreePanel("Group 1", this); jRunQueryButton = new javax.swing.JButton(); jCancelButton = new javax.swing.JButton(); jClearGroupsButton = new javax.swing.JButton(); jScrollPane2 = new QueryConceptTreePanel("Group 2", this); jScrollPane3 = new QueryConceptTreePanel("Group 3", this); jScrollPane4 = new javax.swing.JScrollPane(); jPanel1 = new javax.swing.JPanel(); //jVisitComboBox = new javax.swing.JComboBox(); jAndOrLabel1 = new javax.swing.JLabel(); jAndOrLabel2 = new javax.swing.JLabel(); jMorePanelsButton = new javax.swing.JButton(); //jSlider1 = new javax.swing.JSlider(); //jLabel1 = new javax.swing.JLabel(); //jLabel2 = new javax.swing.JLabel(); setLayout(null); //jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); jPanel1.setLayout(null); jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 180, 200); jPanel1.add(jScrollPane2); jScrollPane2.setBounds(185, 0, 180, 200); jPanel1.add(jScrollPane3); jScrollPane3.setBounds(370, 0, 180, 200); //jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jAndOrLabel1.setText("and"); //jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); //jPanel1.add(jAndOrLabel1); //jAndOrLabel1.setBounds(190, 90, 30, 18); //jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); //jAndOrLabel2.setText("and"); //jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); //jPanel1.add(jAndOrLabel2); //jAndOrLabel2.setBounds(410, 90, 30, 18); jNameLabel.setText("Query Name: "); jNameLabel.setBounds(8, 10, 70, 23); add(jNameLabel); jNameTextField.setText(""); jNameTextField.setBounds(95, 10, 400, 20); jNameTextField.setEditable(false); add(jNameTextField); jClearGroupsButton.setText("Reset Groups"); jClearGroupsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jClearGroupsButtonActionPerformed(evt); } }); jClearGroupsButton.setBounds(600, 10, 100, 20); add(jClearGroupsButton); jPanel1.setPreferredSize(new Dimension(550, 150)); jScrollPane4.setViewportView(jPanel1); add(jScrollPane4); jScrollPane4.setBounds(20, 35, 635, 220); jCancelButton.setText("Cancel"); jCancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jCancelButtonActionPerformed(evt); } }); add(jCancelButton); jCancelButton.setBounds(20, 255, 70, 23); jRunQueryButton.setText("Run Query"); jRunQueryButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRunQueryButtonActionPerformed(evt); } }); add(jRunQueryButton); jRunQueryButton.setBounds(90, 255, 625, 23); jMorePanelsButton.setText("<html><center>Add<br>" + "<left>Group"); jMorePanelsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMorePanelsButtonActionPerformed(evt); } }); add(jMorePanelsButton); jMorePanelsButton.setBounds(655, 35, 60, 220); /*jDeleteButton.setText("Delete"); jDeleteButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jDeleteButtonActionPerformed(evt); } }); jVisitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Groups don't have to occur in the same visit", "Groups must all occur in the same visit" })); add(jVisitComboBox); jVisitComboBox.setBounds(20, 40, 240, 22); //add(jDeleteButton); //jDeleteButton.setBounds(20, 10, 65, 23); add(jScrollPane1); jScrollPane1.setBounds(20, 70, 170, 320); jRunQueryButton.setText("Run Query"); jRunQueryButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRunQueryButtonActionPerformed(evt); } }); add(jRunQueryButton); jRunQueryButton.setBounds(20, 10, 87, 23); jCancelButton.setText("Remove All"); jCancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRemoveAllButtonActionPerformed(evt); } }); add(jCancelButton); jCancelButton.setBounds(115, 10, 90, 23); //jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); jPanel1.setLayout(null); jScrollPane4.getHorizontalScrollBar().setUnitIncrement(20); //jPanel1.setVisible(false); //jScrollPane1.setToolTipText("scrollpane 1"); jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 170, 350); jPanel1.add(jScrollPane2); jScrollPane2.setBounds(210, 0, 170, 350);*/ jAndOrLabel1.setBackground(new java.awt.Color(255, 255, 255)); jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jAndOrLabel1.setText("and"); jAndOrLabel1.setToolTipText("Click to change the relationship"); jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jAndOrLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jAndOrLabel1MouseClicked(evt); } }); //jPanel1.add(jAndOrLabel1); jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jAndOrLabel2.setText("and"); jAndOrLabel2.setToolTipText("Click to change the relationship"); jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jAndOrLabel2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jAndOrLabel2MouseClicked(evt); } }); //jPanel1.add(jAndOrLabel2); /*jPanel1.add(jScrollPane3); jScrollPane3.setBounds(420, 0, 170, 350); jScrollPane4.setViewportView(jPanel1); add(jScrollPane4); jScrollPane4.setBounds(20, 70, 594, 370); jMorePanelsButton.setText("Add Panel"); jMorePanelsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMorePanelsButtonActionPerformed(evt); } }); add(jMorePanelsButton); jMorePanelsButton.setBounds(215, 10, 90, 23);*/ //jTree1.addTreeWillExpandListener(this); //jTree1.addTreeExpansionListener(this); //jScrollPane1.setViewportView(new QueryConceptTreePanel("Group 1")); //jScrollPane1.setToolTipText("Double click on a folder to view the items inside"); //jTree2.addTreeExpansionListener(this); //jScrollPane2.setViewportView(new QueryConceptTreePanel("Group 2")); //jTree3.addTreeExpansionListener(this); //treepanel = new QueryConceptTreePanel("", this); //jScrollPane3.setViewportView(new QueryConceptTreePanel("Group 3")); //jSlider1.setMajorTickSpacing(20); /*jSlider1.setPaintTicks(true); jSlider1.setValue(0); jSlider1.setMinorTickSpacing(10); jSlider1.setToolTipText("Slider on left is more Sensitive Query, " + "on right is more Specific"); add(jSlider1); jSlider1.setBounds(380, 40, 140, 18); //jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel1.setText("Sensitivity <"); add(jLabel1); jLabel1.setBounds(290, 40, 80, 20); //jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); jLabel2.setText("> Specificity"); add(jLabel2); jLabel2.setBounds(525, 40, 70, 20);*/ dataModel.addPanel(jScrollPane1, null, 0); dataModel.addPanel(jScrollPane2, jAndOrLabel1, 0); dataModel.addPanel(jScrollPane3, jAndOrLabel2, 555); }
From source file:greenfoot.gui.export.ExportPublishPane.java
/** * Build the component.//from w w w .ja va 2s . c o m */ private void makePane() { font = (new JLabel()).getFont().deriveFont(Font.ITALIC, 11.0f); setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); setBorder(BorderFactory.createEmptyBorder(12, 12, 0, 12)); setBackground(backgroundColor); add(getHelpBox()); add(Box.createVerticalStrut(12)); infoPanel = new JPanel(new BorderLayout(22, 18)); { infoPanel.setAlignmentX(LEFT_ALIGNMENT); infoPanel.setBackground(background); Border border = BorderFactory.createCompoundBorder(BorderFactory.createLoweredBevelBorder(), BorderFactory.createEmptyBorder(12, 22, 12, 22)); infoPanel.setBorder(border); JLabel text = new JLabel(Config.getString("export.publish.info") + " " + serverName, SwingConstants.CENTER); text.setForeground(headingColor); infoPanel.add(text, BorderLayout.NORTH); createScenarioDisplay(); infoPanel.add(leftPanel, BorderLayout.CENTER); infoPanel.add(getTagDisplay(), BorderLayout.EAST); } add(infoPanel); add(Box.createVerticalStrut(16)); add(getLoginPanel()); add(Box.createVerticalStrut(10)); }
From source file:edu.ku.brc.specify.tasks.subpane.lm.LifeMapperPane.java
/** * Creates the UI.//from w w w. jav a2 s .c om */ @SuppressWarnings("unchecked") protected void createUI() { currentSize = getCurrentSizeSquare(); searchText = createTextField(25); searchSciNameBtn = createI18NButton("LM_SEARCH"); list = new JList(listModel); imgDisplay = new ImageDisplay(IMG_WIDTH, IMG_HEIGHT, false, true); imgDisplay.setChangeListener(this); wwPanel = new WorldWindPanel(false); wwPanel.setPreferredSize(new Dimension(currentSize, currentSize)); wwPanel.setZoomInMeters(600000.0); imgDisplay.setDoShowText(false); searchMyDataBtn = createI18NButton("LM_SRCH_SP_DATA"); myDataTF = UIHelper.createTextField(); CellConstraints cc = new CellConstraints(); PanelBuilder pb1 = new PanelBuilder(new FormLayout("p,2px,f:p:g,2px,p", "p")); pb1.add(createI18NFormLabel("LM_SRCH_COL"), cc.xy(1, 1)); pb1.add(searchText, cc.xy(3, 1)); pb1.add(searchSciNameBtn, cc.xy(5, 1)); PanelBuilder myPB = new PanelBuilder(new FormLayout("f:p:g,p", "p,2px,p,2px,p")); mySepComp = myPB.addSeparator(getResourceString("LM_MYDATA_TITLE"), cc.xyw(1, 1, 2)); myPB.add(myDataTF, cc.xyw(1, 3, 2)); myPB.add(searchMyDataBtn, cc.xy(2, 5)); PanelBuilder pb2 = new PanelBuilder(new FormLayout("MAX(p;300px),2px,f:p:g", "f:p:g,20px,p")); pb2.add(createScrollPane(list), cc.xy(1, 1)); pb2.add(myPB.getPanel(), cc.xy(1, 3)); PanelBuilder pb3 = new PanelBuilder(new FormLayout("f:p:g,p,f:p:g", "f:p:g,p,4px,p,f:p:g")); pb3.add(createI18NLabel("LM_WRLD_OVRVW", SwingConstants.CENTER), cc.xy(2, 2)); pb3.add(imgDisplay, cc.xy(2, 4)); PanelBuilder pb4 = new PanelBuilder(new FormLayout("f:p:g,p,f:p:g", "f:p:g,p,4px,p,f:p:g")); pb4.add(createI18NLabel("LM_INTRACT_VW", SwingConstants.CENTER), cc.xy(2, 2)); pb4.add(wwPanel, cc.xy(2, 4)); PanelBuilder pb5 = new PanelBuilder(new FormLayout("f:p:g", "f:p:g,p,f:p:g")); pb5.add(pb3.getPanel(), cc.xy(1, 1)); pb5.add(pb4.getPanel(), cc.xy(1, 3)); PanelBuilder pb = new PanelBuilder(new FormLayout("p,8px,f:p:g", "p,8px,f:p:g"), this); pb.add(pb1.getPanel(), cc.xyw(1, 1, 3)); pb.add(pb2.getPanel(), cc.xy(1, 3)); pb.add(pb5.getPanel(), cc.xy(3, 3)); updateMyDataUIState(false); searchText.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { searchSciNameBtn.doClick(); } } }); myDataTF.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { searchMyDataBtn.doClick(); } } }); list.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { if (list.getSelectedIndex() == -1) { wwPanel.reset(); imgDisplay.setImage(blueMarble); } else { SwingWorker<Boolean, Boolean> worker = new SwingWorker<Boolean, Boolean>() { @Override protected Boolean doInBackground() throws Exception { if (doResetWWPanel) { wwPanel.reset(); } doSearchOccur(); return null; } @Override protected void done() { imgDisplay.repaint(); } }; worker.execute(); } } } }); searchMyDataBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { doSearchSpecifyData(myDataTF.getText().trim()); } }); } }); searchSciNameBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doSearchGenusSpecies(); } }); blueMarbleListener = new BufferedImageFetcherIFace() { @Override public void imageFetched(BufferedImage image) { blueMarble = image; imgDisplay.setImage(blueMarble); } @Override public void error() { blueMarbleTries++; if (blueMarbleTries < 5) { blueMarbleRetry(); } } }; blueMarbleURL = BG_URL + String.format("WIDTH=%d&HEIGHT=%d", IMG_WIDTH, IMG_HEIGHT); pointsMapImageListener = new BufferedImageFetcherIFace() { @Override public void imageFetched(final BufferedImage image) { if (renderImage == null) { renderImage = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_INT_ARGB); } Graphics2D g2d = renderImage.createGraphics(); if (g2d != null) { g2d.fillRect(0, 0, IMG_WIDTH, IMG_HEIGHT); if (blueMarble != null) { g2d.drawImage(blueMarble, 0, 0, null); } if (image != null) { g2d.drawImage(image, 0, 0, null); } g2d.dispose(); imgDisplay.setImage(renderImage); } } @Override public void error() { } }; blueMarbleRetry(); }
From source file:com.sshtools.common.ui.SshToolsApplicationClientPanel.java
/** * * * @param f//w w w . j av a 2 s . com */ public void open(File f) { log.debug("Opening connection file " + f); // Make sure a connection is not already open if (isConnected()) { Option optNew = new Option("New", "New create a new window", 'n'); Option optClose = new Option("Close", "Close current connection", 'l'); Option optCancel = new Option("Cancel", "Cancel the opening of this connection", 'c'); OptionsDialog dialog = OptionsDialog.createOptionDialog(this, new Option[] { optNew, optClose, optCancel }, "You already have a connection open. Select\n" + "Close to close the current connection, New\n" + "to create a new terminal or Cancel to abort.", "Existing connection", optNew, null, UIManager.getIcon("OptionPane.warningIcon")); UIUtil.positionComponent(SwingConstants.CENTER, dialog); dialog.setVisible(true); Option opt = dialog.getSelectedOption(); if ((opt == null) || (opt == optCancel)) { return; } else if (opt == optNew) { try { SshToolsApplicationContainer c = (SshToolsApplicationContainer) application.newContainer(); ((SshToolsApplicationClientPanel) c.getApplicationPanel()).open(f); return; } catch (SshToolsApplicationException stae) { log.error(stae); } } else { closeConnection(true); } } // Save to MRU if (getApplication().getMRUModel() != null) { getApplication().getMRUModel().add(f); } // Make sure its not invalid if (f != null) { // Create a new connection properties object SshToolsConnectionProfile profile = new SshToolsConnectionProfile(); try { // Open the file profile.open(f.getAbsolutePath()); setNeedSave(false); currentConnectionFile = f; //setContainerTitle(f); // Connect with the new details. connect(profile, false); } catch (InvalidProfileFileException fnfe) { showExceptionMessage(fnfe.getMessage(), "Open Connection"); } catch (SshException e) { e.printStackTrace(); showExceptionMessage("An unexpected error occured!", "Open Connection"); } } else { showExceptionMessage("Invalid file specified", "Open Connection"); } }
From source file:com.rapidminer.gui.properties.OperatorPropertyPanel.java
public OperatorPropertyPanel(final MainFrame mainFrame) { super();//from w w w . jav a2 s . com this.mainFrame = mainFrame; breakpointButton = new BreakpointButton(); headerLabel.setHorizontalAlignment(SwingConstants.CENTER); expertModeHintLabel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); expertModeHintLabel.setIcon(WARNING_ICON); expertModeHintLabel.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { mainFrame.TOGGLE_EXPERT_MODE_ACTION.actionPerformed(null); } }); expertModeHintLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); expertModeHintLabel.setHorizontalAlignment(SwingConstants.LEFT); setupComponents(); compatibilityLevelSpinner.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { // compatibility level OperatorVersion[] versionChanges = operator.getIncompatibleVersionChanges(); // sort to have an ascending order Arrays.sort(versionChanges); if (versionChanges.length != 0) { OperatorVersion latestChange = versionChanges[versionChanges.length - 1]; if (latestChange.isAtLeast(operator.getCompatibilityLevel())) { compatibilityLabel.setIcon(WARNING_ICON); } else { compatibilityLabel.setIcon(SwingTools.createIcon("16/ok.png")); } } } }); showHelpAction = new ToggleAction(true, "show_parameter_help") { private static final long serialVersionUID = 1L; @Override public void actionToggled(ActionEvent e) { setShowParameterHelp(isSelected()); mainFrame.getPropertyPanel().setupComponents(); } }; }
From source file:com.ga.forms.DailyLogUI.java
/** * 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./*from ww w.j av a2s. c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); mainTitleLbl = new javax.swing.JLabel(); jSeparator1 = new javax.swing.JSeparator(); exitButton = new javax.swing.JButton(); exportButton = new javax.swing.JButton(); dailyLogPanel = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); dailyLogTable = new javax.swing.JTable(); addButton = new javax.swing.JButton(); analysisPanel = new javax.swing.JPanel(); netDurationLbl = new javax.swing.JLabel(); durationLbl = new javax.swing.JLabel(); monthlyRequiredDurationLbl = new javax.swing.JLabel(); monthlyDurationLbl = new javax.swing.JLabel(); durationDifferenceLbl = new javax.swing.JLabel(); differenceLbl = new javax.swing.JLabel(); monthCombo = new javax.swing.JComboBox(); yearCombo = new javax.swing.JComboBox(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setMaximumSize(new java.awt.Dimension(395, 389)); jPanel1.setMinimumSize(new java.awt.Dimension(395, 389)); jPanel1.setPreferredSize(new java.awt.Dimension(464, 474)); mainTitleLbl.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N mainTitleLbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); mainTitleLbl.setText("Daily Log Manager"); mainTitleLbl.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); exitButton.setText("Exit"); exitButton.setMaximumSize(new java.awt.Dimension(72, 29)); exitButton.setMinimumSize(new java.awt.Dimension(72, 29)); exitButton.setPreferredSize(new java.awt.Dimension(72, 29)); exitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitButtonActionPerformed(evt); } }); exportButton.setText("Export"); exportButton.setMaximumSize(new java.awt.Dimension(92, 29)); exportButton.setMinimumSize(new java.awt.Dimension(92, 29)); exportButton.setPreferredSize(new java.awt.Dimension(92, 29)); exportButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exportButtonActionPerformed(evt); } }); dailyLogPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Daily Logs")); dailyLogPanel.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dailyLogPanel.setName("Daily Log Entry"); // NOI18N dailyLogPanel.setPreferredSize(new java.awt.Dimension(240, 190)); jScrollPane1.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N dailyLogTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane1.setViewportView(dailyLogTable); javax.swing.GroupLayout dailyLogPanelLayout = new javax.swing.GroupLayout(dailyLogPanel); dailyLogPanel.setLayout(dailyLogPanelLayout); dailyLogPanelLayout.setHorizontalGroup( dailyLogPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 770, Short.MAX_VALUE)); dailyLogPanelLayout .setVerticalGroup(dailyLogPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)); addButton.setText("Add"); addButton.setMaximumSize(new java.awt.Dimension(72, 29)); addButton.setMinimumSize(new java.awt.Dimension(72, 29)); addButton.setPreferredSize(new java.awt.Dimension(72, 29)); addButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addButtonActionPerformed(evt); } }); analysisPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Analysis")); netDurationLbl.setFont(new java.awt.Font("Arial", 1, 13)); // NOI18N netDurationLbl.setText("NET DURATION:"); durationLbl.setFont(new java.awt.Font("Arial", 1, 13)); // NOI18N monthlyRequiredDurationLbl.setFont(new java.awt.Font("Arial", 1, 13)); // NOI18N monthlyRequiredDurationLbl.setText("MONTHLY REQUIRED DURATION:"); monthlyDurationLbl.setFont(new java.awt.Font("Arial", 1, 13)); // NOI18N durationDifferenceLbl.setFont(new java.awt.Font("Arial", 1, 13)); // NOI18N durationDifferenceLbl.setText("DIFFERENCE:"); differenceLbl.setFont(new java.awt.Font("Arial", 1, 13)); // NOI18N javax.swing.GroupLayout analysisPanelLayout = new javax.swing.GroupLayout(analysisPanel); analysisPanel.setLayout(analysisPanelLayout); analysisPanelLayout.setHorizontalGroup(analysisPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(analysisPanelLayout.createSequentialGroup().addContainerGap().addGroup(analysisPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(analysisPanelLayout.createSequentialGroup().addComponent(netDurationLbl) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(durationLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( analysisPanelLayout.createSequentialGroup().addComponent(monthlyRequiredDurationLbl) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(monthlyDurationLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(analysisPanelLayout.createSequentialGroup().addComponent(durationDifferenceLbl) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(differenceLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(18, Short.MAX_VALUE))); analysisPanelLayout .setVerticalGroup(analysisPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(analysisPanelLayout.createSequentialGroup().addContainerGap() .addGroup(analysisPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(netDurationLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(durationLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(analysisPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(monthlyDurationLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(monthlyRequiredDurationLbl)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(analysisPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(differenceLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(durationDifferenceLbl)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); netDurationLbl.getAccessibleContext().setAccessibleName("netDurationLbl"); durationLbl.getAccessibleContext().setAccessibleName("durationLbl"); monthlyRequiredDurationLbl.getAccessibleContext().setAccessibleName("monthlyRequiredDurationLbl"); monthlyDurationLbl.getAccessibleContext().setAccessibleName("monthlyDurationLbl"); durationDifferenceLbl.getAccessibleContext().setAccessibleName("durationDifferenceLbl"); differenceLbl.getAccessibleContext().setAccessibleName("differenceLbl"); monthCombo.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); monthCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { monthComboActionPerformed(evt); } }); yearCombo.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); yearCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { yearComboActionPerformed(evt); } }); jLabel1.setText("Month:"); jLabel2.setText("Year:"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jSeparator1) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(exportButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup().addGap(6, 6, 6) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(analysisPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(monthCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(24, 24, 24).addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(yearCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(mainTitleLbl, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(dailyLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 788, Short.MAX_VALUE)))) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(mainTitleLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(dailyLogPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(analysisPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(monthCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(yearCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1).addComponent(jLabel2))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(exportButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(addButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); exportButton.getAccessibleContext().setAccessibleName("exportButton"); addButton.getAccessibleContext().setAccessibleName("addButton"); analysisPanel.getAccessibleContext().setAccessibleName("analysisPanel"); jLabel1.getAccessibleContext().setAccessibleName("monthLbl"); jLabel2.getAccessibleContext().setAccessibleName("yearLbl"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 800, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE))); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 469, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 469, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); pack(); }