List of usage examples for javax.swing.border EtchedBorder EtchedBorder
public EtchedBorder()
From source file:fxts.stations.util.preferences.PreferencesSheetPanel.java
/** * Constructor PreferencesSheetPanel.//from w w w . j a v a 2 s . co m * * @param aUserName parent dialog included this panel. */ public PreferencesSheetPanel(String aUserName) { mUserName = aUserName; try { mResMan = ResourceManager.getManager("fxts.stations.util.preferences.resources.Resources"); } catch (Exception e) { mLogger.error("The fatal error"); e.printStackTrace(); } mResMan.addLocaleListener(this); //Define table mTableModel = new PrefTableModel(); mTable = new AAJTable(mTableModel); mTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); PreferencesTableCellRenderer renderer = new PreferencesTableCellRenderer(); mTable.setDefaultRenderer(AValueEditorPanel.class, renderer); mEditor = new PreferencesTableCellEditor(); mTable.setDefaultEditor(AValueEditorPanel.class, mEditor); //Do not change columns order mTable.getTableHeader().setReorderingAllowed(false); //Assign exterior a table mTable.setBorder(new EtchedBorder()); //Prepare to used Escape key mDefaultEditingCancelAction = SwingUtilities.getUIActionMap(mTable).get("cancel"); AbstractAction exitAction = new AbstractAction() { /** * Invoked when an action occurs. */ public void actionPerformed(ActionEvent aEvent) { if (mEditor.isEditing()) { mEditor.cancelCellEditing(); if (mDefaultEditingCancelAction != null) { mDefaultEditingCancelAction.actionPerformed(aEvent); } } else { mDefaultExitAction.actionPerformed(aEvent); } } }; KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); mTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(keyStroke, "ExitAction"); SwingUtilities.getUIActionMap(mTable).put("ExitAction", exitAction); super.setViewportView(mTable); }
From source file:MemoryMonitor.java
public MemoryMonitor() { setLayout(new BorderLayout()); setBorder(new TitledBorder(new EtchedBorder(), "Memory Monitor")); add(surf = new Surface()); controls = new JPanel(); controls.setPreferredSize(new Dimension(135, 80)); Font font = new Font("serif", Font.PLAIN, 10); JLabel label = new JLabel("Sample Rate"); label.setFont(font);// www .j a va2s. c om label.setForeground(Color.red); controls.add(label); tf = new JTextField("1000"); tf.setPreferredSize(new Dimension(45, 20)); controls.add(tf); controls.add(label = new JLabel("ms")); label.setFont(font); label.setForeground(Color.red); controls.add(dateStampCB); dateStampCB.setFont(font); addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { removeAll(); if ((doControls = !doControls)) { surf.stop(); add(controls); } else { try { surf.sleepAmount = Long.parseLong(tf.getText().trim()); } catch (Exception ex) { } surf.start(); add(surf); } validate(); repaint(); } }); }
From source file:cn.edu.tsinghua.gui.HistogramDemo.java
/** * Initialize display.//from w w w .j a v a 2 s .c o m * @author Sun Microsystems * @param filename is the image filename */ public HistogramDemo(String filename) { File f = new File(filename); if (f.exists() && f.canRead()) { source = JAI.create("fileload", filename); } else { return; } canvas = new ImageDisplay(source); canvas.setLayout(new FlowLayout(FlowLayout.RIGHT, 2, 2)); panner = new Panner(canvas, source, 128); panner.setBackground(Color.red); panner.setBorder(new EtchedBorder()); canvas.add(panner); Font font = new Font("SansSerif", Font.BOLD, 12); JLabel title = new JLabel(" Histogram"); title.setFont(font); title.setLocation(0, 32); setOpaque(true); setLayout(new BorderLayout()); setBackground(Color.white); graph = new XYPlot(); graph.setBackground(Color.black); graph.setBorder(new LineBorder(new Color(0, 0, 255), 1)); Colorbar cbar = new Colorbar(); cbar.setBackground(Color.black); cbar.setPreferredSize(new Dimension(256, 25)); cbar.setBorder(new LineBorder(new Color(255, 0, 255), 2)); JPanel hist_panel = new JPanel(); hist_panel.setLayout(new BorderLayout()); hist_panel.setBackground(Color.white); hist_panel.add(graph, BorderLayout.CENTER); hist_panel.add(cbar, BorderLayout.SOUTH); JPanel panel = new JPanel(); panel.setLayout(new GridLayout(2, 1, 5, 5)); panel.setBackground(Color.white); panel.add(canvas); panel.add(hist_panel); JPanel controlPanel = new JPanel(); controlPanel.setLayout(new FlowLayout()); reset = new JButton("Reset"); equal = new JButton("Uniform"); norm = new JButton("Gaussian"); piece = new JButton("Piecewise"); reset.addActionListener(this); equal.addActionListener(this); norm.addActionListener(this); piece.addActionListener(this); controlPanel.add(reset); controlPanel.add(equal); controlPanel.add(norm); controlPanel.add(piece); add(title, BorderLayout.NORTH); add(panel, BorderLayout.CENTER); add(controlPanel, BorderLayout.SOUTH); // original histogram (remains unmodified) // graph.plot( getHistogram(source) ); graph.plot(getMultiHistogram(source)); }
From source file:org.ash.gui.MainFrame.java
/** * Jb init./*ww w.j av a2 s . co m*/ * * @throws Exception the exception */ private void jbInit() throws Exception { /** set layout */ this.setLayout(new BorderLayout()); this.tabsMain = new JTabbedPane(); this.model = new Model(); this.splitPaneMain = new JSplitPane(); this.statusBar = new StatusBar(); this.jButtonSettings.setMnemonic(Options.getInstance().getResource("settingsMain.mnemonic").charAt(0)); this.jButtonSettings.setText(Options.getInstance().getResource("settingsMain.text")); this.jButtonSettings.setPreferredSize(new Dimension(100, 30)); this.jButtonSettings.addActionListener(this); this.jButtonThumbnail.setMnemonic(Options.getInstance().getResource("ThumbnailMain.mnemonic").charAt(0)); this.jButtonThumbnail.setText(Options.getInstance().getResource("ThumbnailMain.text")); this.jButtonThumbnail.setPreferredSize(new Dimension(100, 30)); this.jButtonThumbnail.addActionListener(this); /** Button panel fot buttons */ this.buttonPanel = new JToolBar("PanelButton"); this.buttonPanel.setFloatable(false); this.buttonPanel.setBorder(new EtchedBorder()); /** Layout of buttons */ this.buttonPanel.add(Box.createRigidArea(new Dimension(20, 0))); this.buttonPanel.add(this.jButtonSettings); this.buttonPanel.add(Box.createRigidArea(new Dimension(10, 0))); //this.buttonPanel.add(this.jButtonThumbnail); //this.buttonPanel.add(Box.createRigidArea(new Dimension(10, 0))); //this.buttonPanel.add(this.jButtonDetail); //this.buttonPanel.add(Box.createRigidArea(new Dimension(10, 0))); //this.buttonPanel.add(this.spinerRangeWindowLabel); //this.buttonPanel.add(Box.createRigidArea(new Dimension(5, 0))); //this.buttonPanel.add(this.spinerRangeWindow); //this.buttonPanel.add(Box.createRigidArea(new Dimension(this.getWidth()-250, 0))); this.mainPanel = new JPanel(); this.mainPanel.setLayout(new BorderLayout()); this.mainPanel.setVisible(true); this.settingsDialog = new Settings(this); this.settingsDialog.setLocation(buttonPanel.getX() + 100, buttonPanel.getY() + 50); this.settingsDialog.setVisible(false); }
From source file:net.sf.taverna.t2.workbench.views.results.processor.RenderedProcessorResultComponent.java
/** * Creates the component.//from w ww .j a v a2s. c o m */ public RenderedProcessorResultComponent(RendererRegistry rendererRegistry, List<SaveIndividualResultSPI> saveActions) { this.rendererRegistry = rendererRegistry; setLayout(new BorderLayout()); setBorder(new EtchedBorder()); // Results type combo box renderersComboBox = new JComboBox<>(); renderersComboBox.setModel(new DefaultComboBoxModel<String>()); // initially empty renderersComboBox.setRenderer(new ColorCellRenderer()); renderersComboBox.setEditable(false); renderersComboBox.setEnabled(false); // initially disabled // Set the new listener - listen for changes in the currently selected renderer renderersComboBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == SELECTED && !ERROR_DOCUMENT.equals(e.getItem())) // render the result using the newly selected renderer renderResult(); } }); JPanel resultsTypePanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); resultsTypePanel.add(new JLabel("Value type")); resultsTypePanel.add(renderersComboBox); // Refresh (re-render) button refreshButton = new JButton("Refresh", refreshIcon); refreshButton.setEnabled(false); refreshButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { renderResult(); refreshButton.getParent().requestFocusInWindow(); /* * so that the button does not stay focused after it is clicked * on and did its action */ } }); resultsTypePanel.add(refreshButton); // Check box for wrapping text if result is of type "text/plain" wrapTextCheckBox = new JCheckBox(WRAP_TEXT); wrapTextCheckBox.setVisible(false); wrapTextCheckBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { // Should have only one child component holding the rendered result // Check for empty just as well if (renderedResultPanel.getComponents().length == 0) return; if (renderedResultPanel.getComponent(0) instanceof DialogTextArea) { nodeToWrapSelection.put(node.hashCode(), e.getStateChange() == SELECTED); renderResult(); } } }); resultsTypePanel.add(wrapTextCheckBox); // 'Save result' buttons panel saveButtonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); for (SaveIndividualResultSPI action : saveActions) { action.setResultReference(null); final JButton saveButton = new JButton(action.getAction()); saveButton.setEnabled(false); saveButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveButton.getParent().requestFocusInWindow(); /* * so that the button does not stay focused after it is * clicked on and did its action */ } }); saveButtonsPanel.add(saveButton); } // Top panel contains result type combobox and various save buttons JPanel topPanel = new JPanel(); topPanel.setLayout(new BoxLayout(topPanel, LINE_AXIS)); topPanel.add(resultsTypePanel); topPanel.add(saveButtonsPanel); // Rendered results panel - initially empty renderedResultPanel = new JPanel(new BorderLayout()); renderedResultPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); // Add all components add(topPanel, NORTH); add(new JScrollPane(renderedResultPanel), CENTER); }
From source file:org.ash.history.detail.DetailsPanelH.java
/** * Initialize DetailFrame//from www . j a va 2 s .com */ private void initialize() { this.setLayout(new BorderLayout()); JSplitPane splitPaneMainDetail = new JSplitPane(); this.cpuRadioButton.setText(Options.getInstance().getResource("cpuLabel.text")); this.cpuRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.cpuRadioButton); this.schedulerRadioButton.setText(Options.getInstance().getResource("schedulerLabel.text")); this.schedulerRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.schedulerRadioButton); this.userIORadioButton.setText(Options.getInstance().getResource("userIOLabel.text")); this.userIORadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.userIORadioButton); this.systemIORadioButton.setText(Options.getInstance().getResource("systemIOLabel.text")); this.systemIORadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.systemIORadioButton); this.concurrencyRadioButton.setText(Options.getInstance().getResource("concurrencyLabel.text")); this.concurrencyRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.concurrencyRadioButton); this.applicationRadioButton.setText(Options.getInstance().getResource("applicationsLabel.text")); this.applicationRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.applicationRadioButton); this.commitRadioButton.setText(Options.getInstance().getResource("commitLabel.text")); this.commitRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.commitRadioButton); this.configurationRadioButton.setText(Options.getInstance().getResource("configurationLabel.text")); this.configurationRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.configurationRadioButton); this.administrativeRadioButton.setText(Options.getInstance().getResource("administrativeLabel.text")); this.administrativeRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.administrativeRadioButton); this.networkRadioButton.setText(Options.getInstance().getResource("networkLabel.text")); this.networkRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.networkRadioButton); this.queuningRadioButton.setText(Options.getInstance().getResource("queueningLabel.text")); this.queuningRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.queuningRadioButton); this.clusterRadioButton.setText(Options.getInstance().getResource("clusterLabel.text")); this.clusterRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.clusterRadioButton); this.otherRadioButton.setText(Options.getInstance().getResource("otherLabel.text")); this.otherRadioButton.addItemListener(new SelectItemListenerRadioButton()); this.setFont(this.otherRadioButton); this.buttonGroup.add(cpuRadioButton); this.buttonGroup.add(schedulerRadioButton); this.buttonGroup.add(userIORadioButton); this.buttonGroup.add(systemIORadioButton); this.buttonGroup.add(concurrencyRadioButton); this.buttonGroup.add(applicationRadioButton); this.buttonGroup.add(commitRadioButton); this.buttonGroup.add(configurationRadioButton); this.buttonGroup.add(administrativeRadioButton); this.buttonGroup.add(networkRadioButton); this.buttonGroup.add(queuningRadioButton); this.buttonGroup.add(clusterRadioButton); this.buttonGroup.add(otherRadioButton); /** Button panel fot buttons */ this.buttonPanel = new JToolBar("PanelButton"); this.buttonPanel.setFloatable(false); this.buttonPanel.setBorder(new EtchedBorder()); this.buttonPanel.add(this.cpuRadioButton); this.buttonPanel.add(this.schedulerRadioButton); this.buttonPanel.add(this.userIORadioButton); this.buttonPanel.add(this.systemIORadioButton); this.buttonPanel.add(this.concurrencyRadioButton); this.buttonPanel.add(this.applicationRadioButton); this.buttonPanel.add(this.commitRadioButton); this.buttonPanel.add(this.configurationRadioButton); this.buttonPanel.add(this.administrativeRadioButton); this.buttonPanel.add(this.networkRadioButton); this.buttonPanel.add(this.queuningRadioButton); this.buttonPanel.add(this.clusterRadioButton); this.buttonPanel.add(this.otherRadioButton); splitPaneMainDetail.setOrientation(JSplitPane.VERTICAL_SPLIT); splitPaneMainDetail.add(new JPanel(), "top"); splitPaneMainDetail.add(new JPanel(), "bottom"); splitPaneMainDetail.setDividerLocation(230); splitPaneMainDetail.setOneTouchExpandable(true); this.mainPanel = new JPanel(); this.mainPanel.setLayout(new BorderLayout()); this.mainPanel.setVisible(true); this.mainPanel.add(splitPaneMainDetail, BorderLayout.CENTER); this.add(this.buttonPanel, BorderLayout.NORTH); this.add(this.mainPanel, BorderLayout.CENTER); }
From source file:PVGraph.java
private JPanel makeCommonButtonsPanel(final PVGraphView view) { JPanel commonButtonsPanel = new JPanel(); commonButtonsPanel.setBorder(new EtchedBorder()); JButton newGraphButton = new JButton("New Graph"); newGraphButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { new PVGraph((Calendar) PVGraph.this.date.clone(), tabPane.getSelectedIndex()); }/*w w w. j a v a2 s. c o m*/ }); JButton runSmatoolButton = new JButton("Run smatool"); runSmatoolButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { try { runSmatool(); view.updateChart(); } catch (IOException ioe) { System.err.println(ioe.getMessage()); } } }); commonButtonsPanel.add(newGraphButton); if (Integer.decode(props.getProperty("smatool.havebutton", "1")) != 0) commonButtonsPanel.add(runSmatoolButton); int smatoolPeriod = Integer.decode(props.getProperty("smatool.period", "0")); if (smatoolPeriod > 0) { final JRadioButton trackDayRadioButton = new JRadioButton("Track day"); trackDayRadioButton.setSelected(trackDay); trackDayRadioButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { trackDay = trackDayRadioButton.isSelected(); } }); commonButtonsPanel.add(trackDayRadioButton); } return commonButtonsPanel; }
From source file:finale.year.stage.main.Authentification.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./*w ww .ja v a 2s. c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - unknown private void initComponents() { innerPanel = new JPanel(); emailField = new JTextField(); rememberMe = new JCheckBox(); logInBtn = new JButton(); passWord = new JPasswordField(); signUpBtn = new JButton(); forgotBtn = new JButton(); userIcon = new JLabel(); passwordIcon = new JLabel(); errorStatusBar = new JLabel(); //======== this ======== // JFormDesigner evaluation mark setBorder( new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); setLayout(new GridBagLayout()); //======== innerPanel ======== { innerPanel.setBorder(new EtchedBorder()); //---- emailField ---- emailField.setText("Email"); emailField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { emailFieldActionPerformed(e); } }); //---- rememberMe ---- rememberMe.setText("Remember me"); rememberMe.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rememberMeActionPerformed(e); } }); //---- logInBtn ---- logInBtn.setText("Log In"); logInBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { logInBtnActionPerformed(e); } }); //---- passWord ---- passWord.setText("password"); //---- signUpBtn ---- signUpBtn.setText("Sign Up"); signUpBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { signUpBtnActionPerformed(e); } }); //---- forgotBtn ---- forgotBtn.setText("Forgot Password?"); forgotBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { forgotBtnActionPerformed(e); } }); //---- userIcon ---- userIcon.setIcon(new ImageIcon(getClass().getResource("/Resources/glyphicons_user.png"))); //---- passwordIcon ---- passwordIcon.setIcon(new ImageIcon(getClass().getResource("/Resources/glyphicons_lock.png"))); GroupLayout innerPanelLayout = new GroupLayout(innerPanel); innerPanel.setLayout(innerPanelLayout); innerPanelLayout.setHorizontalGroup(innerPanelLayout.createParallelGroup().addGroup(innerPanelLayout .createSequentialGroup() .addGroup(innerPanelLayout.createParallelGroup() .addGroup(innerPanelLayout.createSequentialGroup().addGap(106, 106, 106) .addComponent(forgotBtn)) .addGroup(innerPanelLayout.createSequentialGroup().addGap(73, 73, 73) .addGroup(innerPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(userIcon, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE) .addComponent(passwordIcon, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(innerPanelLayout .createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(passWord).addComponent(emailField, GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE))) .addGroup(innerPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addGroup(innerPanelLayout.createSequentialGroup().addGap(106, 106, 106) .addComponent(rememberMe) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(logInBtn, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)) .addGroup(innerPanelLayout.createSequentialGroup().addGap(375, 375, 375) .addComponent(signUpBtn, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE))) .addGroup(innerPanelLayout.createSequentialGroup().addGap(218, 218, 218) .addComponent(errorStatusBar))) .addContainerGap(100, Short.MAX_VALUE))); innerPanelLayout.setVerticalGroup(innerPanelLayout.createParallelGroup().addGroup(innerPanelLayout .createSequentialGroup().addContainerGap().addComponent(errorStatusBar).addGap(30, 30, 30) .addGroup(innerPanelLayout.createParallelGroup() .addComponent(userIcon, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(emailField, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)) .addGap(30, 30, 30) .addGroup(innerPanelLayout.createParallelGroup() .addComponent(passwordIcon, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE) .addComponent(passWord, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup( innerPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(rememberMe, GroupLayout.PREFERRED_SIZE, 59, GroupLayout.PREFERRED_SIZE) .addComponent(logInBtn)) .addGap(6, 6, 6).addComponent(forgotBtn).addGap(6, 6, 6).addComponent(signUpBtn) .addContainerGap(69, Short.MAX_VALUE))); } add(innerPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), -20, 4)); }
From source file:gda.gui.mca.McaGUI.java
private JPanel getAdcPanel() { gainLabel = new JLabel("Gain"); offsetLabel = new JLabel("Offset"); lldLabel = new JLabel("LLD"); gainField = new JTextField(10); gainField.addActionListener(new ActionListener() { @Override/* ww w . ja v a 2 s . com*/ public void actionPerformed(ActionEvent e) { setAdcValues(); } }); offsetField = new JTextField(10); offsetField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setAdcValues(); } }); lldField = new JTextField(10); lldField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setAdcValues(); } }); adcPanel = new JPanel(); adcPanel.setLayout(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); gc.gridx = GridBagConstraints.RELATIVE; gc.gridy = 0; adcPanel.add(gainLabel, gc); adcPanel.add(gainField, gc); gc.gridx = 0; gc.gridy = GridBagConstraints.RELATIVE; adcPanel.add(offsetLabel, gc); gc.gridx = GridBagConstraints.RELATIVE; gc.gridy = 1; adcPanel.add(offsetField, gc); gc.gridx = 0; gc.gridy = 2; adcPanel.add(lldLabel, gc); gc.gridx = GridBagConstraints.RELATIVE; adcPanel.add(lldField, gc); adcPanel.setBorder(BorderFactory.createTitledBorder(new EtchedBorder(), "ADC")); return adcPanel; }
From source file:hermes.browser.actions.AbstractFIXBrowserDocumentComponent.java
protected JPanel getStatusPanel() { if (statusPanel == null) { statusPanel = new JPanel(); statusPanel.setLayout(new java.awt.BorderLayout()); statusPanel.setAlignmentY(java.awt.Component.BOTTOM_ALIGNMENT); statusMessage.setText("Reading..."); statusMessage.setBorder(new EtchedBorder()); statusPanel.add(statusMessage);/*from ww w. j a v a 2s . c o m*/ } return statusPanel; }