public static void main ( String[] args ) { JPanel middlePanel = new JPanel (); middlePanel.setBorder ( new TitledBorder ( new EtchedBorder (), "Display Area" ) ); // create the middle panel components JTextArea display = new JTextArea ( 16, 58 ); display.setEditable ( false ); // set textArea non-editable JScrollPane scroll = new JScrollPane ( display ); scroll.setVerticalScrollBarPolicy ( ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS ); //Add Textarea in to middle panel middlePanel.add ( scroll ); // My code JFrame frame = new JFrame (); frame.add ( middlePanel ); frame.pack (); frame.setLocationRelativeTo ( null ); frame.setVisible ( true ); }
private void initComponents() { jlInhibitAnyPolicy = new JLabel(res.getString("DInhibitAnyPolicy.jlInhibitAnyPolicy.text")); jlInhibitAnyPolicy.setBorder(new EmptyBorder(5, 5, 0, 5)); jlSkipCertificates = new JLabel(res.getString("DInhibitAnyPolicy.jlSkipCertificates.text")); jtfSkipCertificates = new JTextField(3); jpSkipCertificates = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 5)); jpSkipCertificates.add(jlSkipCertificates); jpSkipCertificates.add(jtfSkipCertificates); jpInhibitAnyPolicy = new JPanel(new BorderLayout(5, 5)); jpInhibitAnyPolicy.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder( new EtchedBorder(), new EmptyBorder(5, 5, 5, 5)))); jpInhibitAnyPolicy.add(jlInhibitAnyPolicy, BorderLayout.NORTH); jpInhibitAnyPolicy.add(jpSkipCertificates, BorderLayout.CENTER); jbCancel = new JButton(res.getString("DInhibitAnyPolicy.jbCancel.text")); jbCancel.addActionListener(new ActionListener() { @Override getContentPane().setLayout(new BorderLayout()); getContentPane().add(jpInhibitAnyPolicy, BorderLayout.CENTER); getContentPane().add(jpButtons, BorderLayout.SOUTH);
public ImageCameraConfigurationWizard(ImageCamera camera) { this.camera = camera; panelGeneral = new JPanel(); contentPanel.add(panelGeneral); panelGeneral.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null), "General", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); panelGeneral.setLayout(new FormLayout( new ColumnSpec[] {FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,}, new RowSpec[] {FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,})); lblSourceUrl = new JLabel("Source URL"); panelGeneral.add(lblSourceUrl, "2, 2, right, default"); textFieldSourceUrl = new JTextField(); panelGeneral.add(textFieldSourceUrl, "4, 2, fill, default"); textFieldSourceUrl.setColumns(10); btnBrowse = new JButton(browseAction); panelGeneral.add(btnBrowse, "6, 2"); }
jPanelXML = new JPanel(); jScrollPaneXML = new JScrollPane(); footer = new JPanel(); databaseLabel = new javax.swing.JLabel(); jPanel1 = new JPanel(); jScrollPane2 = new JScrollPane(); editModeButton = new JToggleButton(); setLayout(new BorderLayout()); jPanel1.setLayout(new BorderLayout()); getResourceConverter().getString( "schemaExplorer.targetLabel.title", "Schema")); targetLabel.setBorder(new EtchedBorder()); getResourceConverter().getString( "schemaExplorer.targetLabel.title", "Schema")); targetLabel2.setBorder(new EtchedBorder()); validStatusLabel2.setFont(new Font("Dialog", Font.PLAIN, 12)); validStatusLabel2.setForeground(Color.RED);
public ClassListItem(Class<? extends T1> clz) { this.clz = clz; }
private void initComponents() { getContentPane().setLayout(new BorderLayout()); JLabel catalogueNameLabel = new JLabel("Service Catalogue name"); catalogueNameLabel.setBorder(new EmptyBorder(5, 5, 5, 5)); JLabel catalogueURLLabel = new JLabel("Service Catalogue URL"); catalogueURLLabel.setBorder(new EmptyBorder(5, 5, 5, 5)); catalogueNameField = new JTextField(15); catalogueURLField = new JTextField(15); JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { JPanel mainPanel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new GridLayout(2, 2, 5, 5)); panel.add(catalogueNameLabel); panel.add(catalogueNameField); panel.add(catalogueURLLabel); panel.add(catalogueURLField); panel.setBorder(new CompoundBorder(new EmptyBorder(10, 10, 10, 10), new EtchedBorder())); mainPanel.add(panel, BorderLayout.CENTER);
public SwingSelectDevicePanel(EmulatorContext emulatorContext) { this.emulatorContext = emulatorContext; setLayout(new BorderLayout()); setBorder(new TitledBorder(new EtchedBorder(), "Installed devices")); lsDevicesModel = new DefaultListModel(); lsDevices = new JList(lsDevicesModel); lsDevices.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); lsDevices.addListSelectionListener(listSelectionListener); spDevices = new JScrollPane(lsDevices); add(spDevices, BorderLayout.CENTER); JPanel panel = new JPanel(); btAdd = new JButton("Add..."); btAdd.addActionListener(btAddListener); btRemove = new JButton("Remove"); btRemove.addActionListener(btRemoveListener); btDefault = new JButton("Set as default"); btDefault.addActionListener(btDefaultListener); panel.add(btAdd); panel.add(btRemove); panel.add(btDefault); add(panel, BorderLayout.SOUTH); for (Enumeration e = Config.getDeviceEntries().elements(); e.hasMoreElements();) { DeviceEntry entry = (DeviceEntry) e.nextElement(); lsDevicesModel.addElement(entry); if (entry.isDefaultDevice()) { lsDevices.setSelectedValue(entry, true); } } }
setLayout(new BorderLayout()); setBorder(new EtchedBorder()); renderersComboBox.setEnabled(false); // initially disabled JPanel resultsTypePanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); resultsTypePanel.add(new JLabel("Result Type")); resultsTypePanel.add(renderersComboBox); action.setResultReference(null); action.setInvocationContext(null); JButton saveButton = new JButton(action.getAction()); saveButton.setEnabled(false); saveButtonsPanel.add(saveButton); renderedResultPanel = new JPanel(new BorderLayout()); renderedResultPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
public JPanel createpanelTableAndColumn() { JPanel jpanel1 = new JPanel(); jpanel1.setName("panelTableAndColumn"); EtchedBorder etchedborder1 = new EtchedBorder(EtchedBorder.RAISED, null, null); jpanel1.setBorder(etchedborder1); FormLayout formlayout1 = new FormLayout( "FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE", "CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE"); CellConstraints cc = new CellConstraints(); jpanel1.setLayout(formlayout1); lblTitleTable.setBackground(new Color(102, 102, 102)); lblTitleTable.setName("lblTitleTable"); lblTitleTable.setOpaque(true); lblTitleTable.setText(" Used tables"); jpanel1.add(lblTitleTable, cc.xywh(1, 1, 5, 1)); lblTablename.setName("lblTablename"); lblTablename.setText("table name"); jpanel1.add(lblTablename, cc.xy(2, 3)); tfTablename.setName("tfTablename"); jpanel1.add(tfTablename, cc.xy(4, 3)); return jpanel1; }
JPanel options = new JPanel(new GridBagLayout()); options.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), "Observer Control")); final JTextField refreshintervaltf = new JTextField(""+refreshinterval, 5); refreshintervaltf.addActionListener(new ActionListener() JButton refresh = new JButton("Refresh highscore"); refresh.addActionListener(new ActionListener() options.add(new JLabel("Autorefresh highscore [millis, -1 for off]"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insets, 0 , 0)); options.add(refreshintervaltf, new GridBagConstraints(1, 0, 3, 1, 1, 0,
/** * Creates the GUI */ @Override protected void completeSubClassGUI() { setLayout(new VerticalLayout(VerticalLayout.LEFT, true)); Class cls = (Class) this.objectValue; Constructor[] array = cls.getDeclaredConstructors(); for (int i = 0; i < array.length; ++i) { Constructor c = array[i]; JButton button = new JButton("Create"); button.addActionListener(this); JPanel pbutton = new JPanel(); pbutton.setLayout(new FlowLayout(FlowLayout.RIGHT)); pbutton.add(button); MethodParametersPanel pparams; pparams = new MethodParametersPanel(context, c); JPanel pmain = new JPanel(); pmain.setLayout(new BorderLayout()); pmain.add("Center", pparams); pmain.add("West", pbutton); EtchedBorder border = new EtchedBorder(EtchedBorder.LOWERED); pmain.setBorder(border); buttons.put(button, c); panels.put(button, pparams); add(pmain); } }
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); label.setForeground(Color.black); controls.add(label); tf = new JTextField("1000"); tf.setPreferredSize(new Dimension(45,20)); controls.add(tf); controls.add(label = new JLabel("ms"));
private JPanel createAdvancedPanel() { JPanel advancedPanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.gridy = 0; c.weightx = 0.10; averageCMCLabel = new JLabel("Average CMC:"); advancedPanel.add(averageCMCLabel, c); String cmcSelected = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_DECK_GENERATOR_ADVANCED_CMC, DeckGeneratorCMC.Default.name()); cbCMC.setSelectedItem(DeckGeneratorCMC.valueOf(cmcSelected)); advancedPanel.add(cbCMC, c); c.gridwidth = 1; c.gridy = 2; btnReset = new JButton("Reset"); btnReset.setToolTipText("Reset advanced dialog to default values"); btnReset.addActionListener(actionEvent -> { cbCMC.setSelectedItem(DeckGeneratorCMC.Default); adjustingSliderPanel.resetValues(); CompoundBorder border = BorderFactory.createCompoundBorder(new EtchedBorder(), new EmptyBorder(10, 10, 10, 10)); advancedPanel.setBorder(border);
public void initComponents() { setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JPanel top = new JPanel(); top.setLayout(new GridLayout(0, 1)); top.setBorder(BorderFactory.createCompoundBorder(new EtchedBorder(EtchedBorder.LOWERED), BorderFactory.createEmptyBorder(10, 10, 10, 10))); tests = new JComboBox(model.getComboModel()); top.add(new JLabel("Choose a test:")); top.add(tests); JPanel middle = new JPanel(); middle.setLayout(new GridLayout(0, 1)); middle.setBorder(BorderFactory.createCompoundBorder(new EtchedBorder(EtchedBorder.LOWERED), BorderFactory.createEmptyBorder(5, 10, 5, 10))); pauseButton.setAlignmentX(CENTER_ALIGNMENT); stepButton.setAlignmentX(CENTER_ALIGNMENT); resetButton.setAlignmentX(CENTER_ALIGNMENT); saveButton.setAlignmentX(CENTER_ALIGNMENT); loadButton.setAlignmentX(CENTER_ALIGNMENT);
public PreferencesPage(String title) { super(new BorderLayout( 10, 10)); titleLabel = new JLabel(title); titleLabel.setBorder(new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))); titleLabel.setBackground(Color.white); titleLabel.setOpaque(true); titleLabel.setFont(titleLabel.getFont().deriveFont( (float)16)); add(titleLabel, BorderLayout.NORTH); JPanel southPanel = new JPanel(new BorderLayout()); southPanel.add(new JSeparator(), BorderLayout.SOUTH); add(southPanel, BorderLayout.SOUTH); }
public WelcomePanel() { iconLabel = new JLabel(); contentPanel = getContentPanel(); contentPanel.setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); icon = getImageIcon(); setLayout(new java.awt.BorderLayout()); if (icon != null) iconLabel.setIcon(icon); iconLabel.setBorder(new EtchedBorder(EtchedBorder.RAISED)); add(iconLabel, BorderLayout.WEST); JPanel secondaryPanel = new JPanel(); secondaryPanel.add(contentPanel, BorderLayout.NORTH); add(secondaryPanel, BorderLayout.CENTER); }
/** * Creates a PortInformation */ public PortViewer() { this.panel = new JPanel(); this.panel.setMinimumSize(SwingUtil.MINIMUM_SIZE); this.panel.setPreferredSize(new Dimension(0, 150)); JPanel inBox = new JPanel(new BorderLayout()); inBox.setBorder(new TitledBorder(new EtchedBorder(), "Input Parameter")); this.inputEditor = createEditorPane(); JScrollPane inputScrollPane = new JScrollPane(this.inputEditor); inputScrollPane.setMinimumSize(SwingUtil.MINIMUM_SIZE); inBox.add(inputScrollPane, BorderLayout.CENTER); inBox.setMinimumSize(SwingUtil.MINIMUM_SIZE); JPanel outBox = new JPanel(new BorderLayout()); outBox.setBorder(new TitledBorder(new EtchedBorder(), "Output Parameter")); this.outputEditor = createEditorPane(); JScrollPane outScrollPane = new JScrollPane(this.outputEditor); outScrollPane.setMinimumSize(SwingUtil.MINIMUM_SIZE); outBox.add(outScrollPane, BorderLayout.CENTER); outBox.setMinimumSize(SwingUtil.MINIMUM_SIZE); this.panel.setLayout(new GridLayout(1, 2)); this.panel.add(outBox); this.panel.add(inBox); }
public BannerPanel() { setBorder( new CompoundBorder(new EtchedBorder(), LookAndFeelTweaks.PANEL_BORDER)); setOpaque(true); setBackground(UIManager.getColor("Table.background")); titleLabel = new JLabel(); titleLabel.setOpaque(false); subtitleLabel = new JEditorPane("text/html", "<html>"); subtitleLabel.setFont(titleLabel.getFont()); LookAndFeelTweaks.makeBold(titleLabel); LookAndFeelTweaks.makeMultilineLabel(subtitleLabel); LookAndFeelTweaks.htmlize(subtitleLabel); iconLabel = new JLabel(); iconLabel.setPreferredSize(new Dimension(50, 50)); setLayout(new BorderLayout()); JPanel nestedPane = new JPanel(new BorderLayout()); nestedPane.setOpaque(false); nestedPane.add("North", titleLabel); nestedPane.add("Center", subtitleLabel); add("Center", nestedPane); add("East", iconLabel); }
private void initComponents() { cardLayout = new CardLayout(); labelPanel = new JPanel(cardLayout); labelPanel.setBorder(new EtchedBorder(EtchedBorder.RAISED)); labelPanel.setFocusable(true); labelPanel.addFocusListener(new MyFocusListener()); labelPanel.setTransferHandler(new MyTransferHandler()); labelPanel.addMouseListener(new MyMouseListener()); labelPanel.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_DOWN_MASK), "doCopy"); //$NON-NLS-1$ labelPanel.getActionMap().put("doCopy", TransferHandler.getCopyAction()); //$NON-NLS-1$ labelPanel.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK), "doPaste"); //$NON-NLS-1$ labelPanel.getActionMap().put("doPaste", //$NON-NLS-1$ TransferHandler.getPasteAction()); imageComponent = new JImage(); labelPanel.add(imageComponent, "image"); //$NON-NLS-1$ waitGlassPane = new JWaitGlassPane(); labelPanel.add(waitGlassPane, "wait"); //$NON-NLS-1$ noImageLabel = new JLabel(SwingMessages.getString("JImageCropping.6"), JLabel.CENTER); //$NON-NLS-1$ labelPanel.add(noImageLabel, "noImage"); //$NON-NLS-1$ cardLayout.show(labelPanel, "noImage"); //$NON-NLS-1$ popupMenu = new JPopupMenu(); popupMenu.add(new PasteAction()); cropButton = new JButton(cropAction); }
public void jbInit() { bdPanel= BorderFactory.createCompoundBorder( new EtchedBorder( EtchedBorder.LOWERED, Color.white, new Color(134, 134, 134)), BorderFactory.createEmptyBorder(5, 5, 5, 5)); titledBorder1= new TitledBorder(""); titledBorder2= new TitledBorder(""); lyPanel.setColumns(4); lyPanel.setHgap(5); setLayout(lyPanel); setBorder(bdPanel); lbTroncon.setText("Tronon"); tfNumTroncon.setPreferredSize(new Dimension(40, 21)); tfNumTroncon.setEditable(false); tfNumTroncon.setHorizontalAlignment(SwingConstants.RIGHT); lbNbElements.setText("Nombre d'lments"); tfNbElements.addFocusListener(this); pnNumTroncon.setLayout(lyNumTroncon); btMnNumTroncon.setBorder(BorderFactory.createEtchedBorder()); btMnNumTroncon.setText("-"); btMnNumTroncon.addActionListener(this);