List of usage examples for javax.swing JScrollPane setViewportView
public void setViewportView(Component view)
From source file:org.jets3t.gui.UserInputFields.java
/** * Builds a user input panel matching the fields specified in the uploader.properties file. * * @param fieldsPanel/* ww w . ja va2s . c om*/ * the panel component to add prompt and user input components to. * @param uploaderProperties * properties specific to the Uploader application that includes the field.* settings * necessary to build the User Inputs screen. * * @return * true if there is at least one valid user input field, false otherwise. */ public boolean buildFieldsPanel(JPanel fieldsPanel, Jets3tProperties uploaderProperties) { int fieldIndex = 0; for (int fieldNo = 0; fieldNo < 100; fieldNo++) { String fieldName = uploaderProperties.getStringProperty("field." + fieldNo + ".name", null); String fieldType = uploaderProperties.getStringProperty("field." + fieldNo + ".type", null); String fieldPrompt = uploaderProperties.getStringProperty("field." + fieldNo + ".prompt", null); String fieldOptions = uploaderProperties.getStringProperty("field." + fieldNo + ".options", null); String fieldDefault = uploaderProperties.getStringProperty("field." + fieldNo + ".default", null); if (fieldName == null) { log.debug("No field with index number " + fieldNo); continue; } else { if (fieldType == null || fieldPrompt == null) { log.warn("Field '" + fieldName + "' missing .type or .prompt properties"); continue; } if ("message".equals(fieldType)) { JHtmlLabel label = skinsFactory.createSkinnedJHtmlLabel(fieldName); label.setText(fieldPrompt); label.setHyperlinkeActivatedListener(hyperlinkListener); fieldsPanel.add(label, new GridBagConstraints(0, fieldIndex++, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); } else if ("radio".equals(fieldType)) { if (fieldOptions == null) { log.warn( "Radio button field '" + fieldName + "' is missing the required .options property"); continue; } JHtmlLabel label = skinsFactory.createSkinnedJHtmlLabel(fieldName); label.setText(fieldPrompt); label.setHyperlinkeActivatedListener(hyperlinkListener); fieldsPanel.add(label, new GridBagConstraints(0, fieldIndex++, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); JPanel optionsPanel = skinsFactory.createSkinnedJPanel("OptionsPanel"); optionsPanel.setLayout(new GridBagLayout()); int columnOffset = 0; ButtonGroup buttonGroup = new ButtonGroup(); StringTokenizer st = new StringTokenizer(fieldOptions, ","); while (st.hasMoreTokens()) { String option = st.nextToken(); JRadioButton radioButton = skinsFactory.createSkinnedJRadioButton(fieldName); radioButton.setText(option); buttonGroup.add(radioButton); if (fieldDefault != null && fieldDefault.equals(option)) { // This option is the default one. radioButton.setSelected(true); } else if (buttonGroup.getButtonCount() == 1) { // Make first button the default. radioButton.setSelected(true); } optionsPanel.add(radioButton, new GridBagConstraints(columnOffset++, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0)); } fieldsPanel.add(optionsPanel, new GridBagConstraints(0, fieldIndex++, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsNone, 0, 0)); userInputComponentsMap.put(fieldName, buttonGroup); } else if ("selection".equals(fieldType)) { if (fieldOptions == null) { log.warn( "Radio button field '" + fieldName + "' is missing the required .options property"); continue; } JHtmlLabel label = skinsFactory.createSkinnedJHtmlLabel(fieldName); label.setText(fieldPrompt); label.setHyperlinkeActivatedListener(hyperlinkListener); fieldsPanel.add(label, new GridBagConstraints(0, fieldIndex++, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); JComboBox comboBox = skinsFactory.createSkinnedJComboBox(fieldName); StringTokenizer st = new StringTokenizer(fieldOptions, ","); while (st.hasMoreTokens()) { String option = st.nextToken(); comboBox.addItem(option); } if (fieldDefault != null) { comboBox.setSelectedItem(fieldDefault); } fieldsPanel.add(comboBox, new GridBagConstraints(0, fieldIndex++, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); userInputComponentsMap.put(fieldName, comboBox); } else if ("text".equals(fieldType)) { JHtmlLabel label = skinsFactory.createSkinnedJHtmlLabel(fieldName); label.setText(fieldPrompt); label.setHyperlinkeActivatedListener(hyperlinkListener); fieldsPanel.add(label, new GridBagConstraints(0, fieldIndex++, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); JTextField textField = skinsFactory.createSkinnedJTextField(fieldName); if (fieldDefault != null) { textField.setText(fieldDefault); } fieldsPanel.add(textField, new GridBagConstraints(0, fieldIndex++, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); userInputComponentsMap.put(fieldName, textField); } else if ("password".equals(fieldType)) { JHtmlLabel label = skinsFactory.createSkinnedJHtmlLabel(fieldName); label.setText(fieldPrompt); label.setHyperlinkeActivatedListener(hyperlinkListener); fieldsPanel.add(label, new GridBagConstraints(0, fieldIndex++, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); JPasswordField passwordField = skinsFactory.createSkinnedJPasswordField(fieldName); if (fieldDefault != null) { passwordField.setText(fieldDefault); } fieldsPanel.add(passwordField, new GridBagConstraints(0, fieldIndex++, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); userInputComponentsMap.put(fieldName, passwordField); } else if (fieldType.equals("textarea")) { JHtmlLabel label = skinsFactory.createSkinnedJHtmlLabel(fieldName); label.setText(fieldPrompt); label.setHyperlinkeActivatedListener(hyperlinkListener); fieldsPanel.add(label, new GridBagConstraints(0, fieldIndex++, 2, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); JTextArea textArea = skinsFactory.createSkinnedJTextArea(fieldName); textArea.setLineWrap(true); if (fieldDefault != null) { textArea.setText(fieldDefault); } JScrollPane scrollPane = skinsFactory.createSkinnedJScrollPane(fieldName); scrollPane.setViewportView(textArea); fieldsPanel.add(scrollPane, new GridBagConstraints(0, fieldIndex++, 2, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, insetsDefault, 0, 0)); userInputComponentsMap.put(fieldName, textArea); } else { log.warn("Unrecognised .type setting for field '" + fieldName + "'"); } } } return isUserInputFieldsAvailable(); }
From source file:org.jimcat.gui.perspective.detail.DetailSideBar.java
/** * creates image Detail - Section//from w ww . j a v a 2s . co m * * @return the Component used to show details */ private JComponent createImageDetail() { JLabel tmp = null; // Task Panel JXTaskPaneContainer container = new JXTaskPaneContainer(); container.setOpaque(false); // General Infos JXTaskPane general = new JXTaskPane(); general.setOpaque(true); general.setTitle("General Info"); general.setExpanded(true); // General info list JPanel info = new JPanel(); GridLayout infoLayout = new GridLayout(0, 2); infoLayout.setHgap(5); info.setLayout(infoLayout); info.setOpaque(false); tmp = new JLabel("Title"); tmp.setFont(labelFont); info.add(tmp); info.add(title); tmp = new JLabel("Rating"); tmp.setFont(labelFont); info.add(tmp); rating = new RatingEditor(); info.add(rating); tmp = new JLabel("Dimension"); tmp.setFont(labelFont); info.add(tmp); dimension = new JLabel(""); info.add(dimension); tmp = new JLabel("Size"); tmp.setFont(labelFont); info.add(tmp); size = new JLabel(""); info.add(size); tmp = new JLabel("Location"); tmp.setFont(labelFont); info.add(tmp); path = new JLabel(""); path.setToolTipText(""); info.add(path); general.add(info); container.add(general); // Exif data JXTaskPane exifs = new JXTaskPane(); exifs.setOpaque(true); exifs.setTitle("Exif Infos"); exifs.setExpanded(true); exifList = new ExifList(); exifs.add(exifList); container.add(exifs); // Tags JXTaskPane tags = new JXTaskPane(); tags.setOpaque(true); tags.setTitle("Associated Tags"); tags.setExpanded(true); // associated tags-list detailTagList = new DetailTagList(); tags.add(detailTagList); container.add(tags); // Modify Tags JXTaskPane filter = new JXTaskPane(); filter.setTitle("Modify Tags"); filter.setExpanded(false); filter.setOpaque(true); tagTree = new TagTree(); tagTree.addTagTreeListener(this); filter.setLayout(new BorderLayout()); filter.addMouseListener(new TagPanelPopupHandler(filter)); filter.add(tagTree, BorderLayout.CENTER); container.add(filter); JScrollPane pane = new JScrollPane(); pane.setOpaque(true); pane.setBorder(null); pane.setViewportView(container); pane.putClientProperty(SubstanceLookAndFeel.WATERMARK_TO_BLEED, Boolean.TRUE); return pane; }
From source file:org.jtrfp.trcl.gui.ConfigWindow.java
public ConfigWindow() { setTitle("Settings"); setSize(340, 540);//from ww w . ja v a 2s . com if (config == null) config = new TRConfiguration(); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); getContentPane().add(tabbedPane, BorderLayout.CENTER); JPanel generalTab = new JPanel(); tabbedPane.addTab("General", new ImageIcon(ConfigWindow.class .getResource("/org/freedesktop/tango/22x22/mimetypes/application-x-executable.png")), generalTab, null); GridBagLayout gbl_generalTab = new GridBagLayout(); gbl_generalTab.columnWidths = new int[] { 0, 0 }; gbl_generalTab.rowHeights = new int[] { 0, 188, 222, 0 }; gbl_generalTab.columnWeights = new double[] { 1.0, Double.MIN_VALUE }; gbl_generalTab.rowWeights = new double[] { 0.0, 1.0, 0.0, Double.MIN_VALUE }; generalTab.setLayout(gbl_generalTab); JPanel settingsLoadSavePanel = new JPanel(); GridBagConstraints gbc_settingsLoadSavePanel = new GridBagConstraints(); gbc_settingsLoadSavePanel.insets = new Insets(0, 0, 5, 0); gbc_settingsLoadSavePanel.anchor = GridBagConstraints.WEST; gbc_settingsLoadSavePanel.gridx = 0; gbc_settingsLoadSavePanel.gridy = 0; generalTab.add(settingsLoadSavePanel, gbc_settingsLoadSavePanel); settingsLoadSavePanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null), "Overall Settings", TitledBorder.LEADING, TitledBorder.TOP, null, null)); FlowLayout flowLayout_1 = (FlowLayout) settingsLoadSavePanel.getLayout(); flowLayout_1.setAlignment(FlowLayout.LEFT); JButton btnSave = new JButton("Export..."); btnSave.setToolTipText("Export these settings to an external file"); settingsLoadSavePanel.add(btnSave); btnSave.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { exportSettings(); } }); JButton btnLoad = new JButton("Import..."); btnLoad.setToolTipText("Import an external settings file"); settingsLoadSavePanel.add(btnLoad); btnLoad.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { importSettings(); } }); JButton btnConfigReset = new JButton("Reset"); btnConfigReset.setToolTipText("Reset all settings to defaults"); settingsLoadSavePanel.add(btnConfigReset); btnConfigReset.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { defaultSettings(); } }); JPanel registeredPODsPanel = new JPanel(); registeredPODsPanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null), "Registered PODs", TitledBorder.LEFT, TitledBorder.TOP, null, null)); GridBagConstraints gbc_registeredPODsPanel = new GridBagConstraints(); gbc_registeredPODsPanel.insets = new Insets(0, 0, 5, 0); gbc_registeredPODsPanel.fill = GridBagConstraints.BOTH; gbc_registeredPODsPanel.gridx = 0; gbc_registeredPODsPanel.gridy = 1; generalTab.add(registeredPODsPanel, gbc_registeredPODsPanel); GridBagLayout gbl_registeredPODsPanel = new GridBagLayout(); gbl_registeredPODsPanel.columnWidths = new int[] { 272, 0 }; gbl_registeredPODsPanel.rowHeights = new int[] { 76, 0, 0 }; gbl_registeredPODsPanel.columnWeights = new double[] { 1.0, Double.MIN_VALUE }; gbl_registeredPODsPanel.rowWeights = new double[] { 1.0, 1.0, Double.MIN_VALUE }; registeredPODsPanel.setLayout(gbl_registeredPODsPanel); JPanel podListPanel = new JPanel(); GridBagConstraints gbc_podListPanel = new GridBagConstraints(); gbc_podListPanel.insets = new Insets(0, 0, 5, 0); gbc_podListPanel.fill = GridBagConstraints.BOTH; gbc_podListPanel.gridx = 0; gbc_podListPanel.gridy = 0; registeredPODsPanel.add(podListPanel, gbc_podListPanel); podListPanel.setLayout(new BorderLayout(0, 0)); JScrollPane podListScrollPane = new JScrollPane(); podListPanel.add(podListScrollPane, BorderLayout.CENTER); podList = new JList(podLM); podList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); podListScrollPane.setViewportView(podList); JPanel podListOpButtonPanel = new JPanel(); podListOpButtonPanel.setBorder(null); GridBagConstraints gbc_podListOpButtonPanel = new GridBagConstraints(); gbc_podListOpButtonPanel.anchor = GridBagConstraints.NORTH; gbc_podListOpButtonPanel.gridx = 0; gbc_podListOpButtonPanel.gridy = 1; registeredPODsPanel.add(podListOpButtonPanel, gbc_podListOpButtonPanel); FlowLayout flowLayout = (FlowLayout) podListOpButtonPanel.getLayout(); flowLayout.setAlignment(FlowLayout.LEFT); JButton addPodButton = new JButton("Add..."); addPodButton.setIcon( new ImageIcon(ConfigWindow.class.getResource("/org/freedesktop/tango/16x16/actions/list-add.png"))); addPodButton.setToolTipText("Add a POD to the registry to be considered when running a game."); podListOpButtonPanel.add(addPodButton); addPodButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { addPOD(); } }); JButton removePodButton = new JButton("Remove"); removePodButton.setIcon(new ImageIcon( ConfigWindow.class.getResource("/org/freedesktop/tango/16x16/actions/list-remove.png"))); removePodButton.setToolTipText("Remove a POD file from being considered when playing a game"); podListOpButtonPanel.add(removePodButton); removePodButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { podLM.removeElement(podList.getSelectedValue()); } }); JButton podEditButton = new JButton("Edit..."); podEditButton.setIcon(null); podEditButton.setToolTipText("Edit the selected POD path"); podListOpButtonPanel.add(podEditButton); podEditButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { editPODPath(); } }); JPanel missionPanel = new JPanel(); GridBagConstraints gbc_missionPanel = new GridBagConstraints(); gbc_missionPanel.fill = GridBagConstraints.BOTH; gbc_missionPanel.gridx = 0; gbc_missionPanel.gridy = 2; generalTab.add(missionPanel, gbc_missionPanel); missionPanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null), "Missions", TitledBorder.LEADING, TitledBorder.TOP, null, null)); GridBagLayout gbl_missionPanel = new GridBagLayout(); gbl_missionPanel.columnWidths = new int[] { 0, 0 }; gbl_missionPanel.rowHeights = new int[] { 0, 0, 0 }; gbl_missionPanel.columnWeights = new double[] { 1.0, Double.MIN_VALUE }; gbl_missionPanel.rowWeights = new double[] { 1.0, 0.0, Double.MIN_VALUE }; missionPanel.setLayout(gbl_missionPanel); JScrollPane scrollPane = new JScrollPane(); GridBagConstraints gbc_scrollPane = new GridBagConstraints(); gbc_scrollPane.insets = new Insets(0, 0, 5, 0); gbc_scrollPane.fill = GridBagConstraints.BOTH; gbc_scrollPane.gridx = 0; gbc_scrollPane.gridy = 0; missionPanel.add(scrollPane, gbc_scrollPane); missionList = new JList(missionLM); missionList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scrollPane.setViewportView(missionList); JPanel missionListOpButtonPanel = new JPanel(); GridBagConstraints gbc_missionListOpButtonPanel = new GridBagConstraints(); gbc_missionListOpButtonPanel.anchor = GridBagConstraints.NORTH; gbc_missionListOpButtonPanel.gridx = 0; gbc_missionListOpButtonPanel.gridy = 1; missionPanel.add(missionListOpButtonPanel, gbc_missionListOpButtonPanel); JButton addVOXButton = new JButton("Add..."); addVOXButton.setIcon( new ImageIcon(ConfigWindow.class.getResource("/org/freedesktop/tango/16x16/actions/list-add.png"))); addVOXButton.setToolTipText("Add an external VOX file as a mission"); missionListOpButtonPanel.add(addVOXButton); addVOXButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { addVOX(); } }); final JButton removeVOXButton = new JButton("Remove"); removeVOXButton.setIcon(new ImageIcon( ConfigWindow.class.getResource("/org/freedesktop/tango/16x16/actions/list-remove.png"))); removeVOXButton.setToolTipText("Remove the selected mission"); missionListOpButtonPanel.add(removeVOXButton); removeVOXButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { missionLM.remove(missionList.getSelectedIndex()); } }); final JButton editVOXButton = new JButton("Edit..."); editVOXButton.setToolTipText("Edit the selected Mission's VOX path"); missionListOpButtonPanel.add(editVOXButton); editVOXButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { editVOXPath(); } }); missionList.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent evt) { final String val = (String) missionList.getSelectedValue(); if (val == null) missionList.setSelectedIndex(0); else if (isBuiltinVOX(val)) { removeVOXButton.setEnabled(false); editVOXButton.setEnabled(false); } else { removeVOXButton.setEnabled(true); editVOXButton.setEnabled(true); } } }); JPanel soundTab = new JPanel(); tabbedPane.addTab("Sound", new ImageIcon( ConfigWindow.class.getResource("/org/freedesktop/tango/22x22/devices/audio-card.png")), soundTab, null); GridBagLayout gbl_soundTab = new GridBagLayout(); gbl_soundTab.columnWidths = new int[] { 0, 0 }; gbl_soundTab.rowHeights = new int[] { 65, 51, 70, 132, 0, 0, 0 }; gbl_soundTab.columnWeights = new double[] { 1.0, Double.MIN_VALUE }; gbl_soundTab.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; soundTab.setLayout(gbl_soundTab); JPanel checkboxPanel = new JPanel(); GridBagConstraints gbc_checkboxPanel = new GridBagConstraints(); gbc_checkboxPanel.insets = new Insets(0, 0, 5, 0); gbc_checkboxPanel.fill = GridBagConstraints.BOTH; gbc_checkboxPanel.gridx = 0; gbc_checkboxPanel.gridy = 0; soundTab.add(checkboxPanel, gbc_checkboxPanel); chckbxLinearInterpolation = new JCheckBox("Linear Filtering"); chckbxLinearInterpolation.setToolTipText("Use the GPU's TMU to smooth playback of low-rate samples."); chckbxLinearInterpolation.setHorizontalAlignment(SwingConstants.LEFT); checkboxPanel.add(chckbxLinearInterpolation); chckbxLinearInterpolation.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { needRestart = true; } }); chckbxBufferLag = new JCheckBox("Buffer Lag"); chckbxBufferLag.setToolTipText("Improves efficiency, doubles latency."); checkboxPanel.add(chckbxBufferLag); JPanel modStereoWidthPanel = new JPanel(); FlowLayout flowLayout_2 = (FlowLayout) modStereoWidthPanel.getLayout(); flowLayout_2.setAlignment(FlowLayout.LEFT); modStereoWidthPanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null), "MOD Stereo Width", TitledBorder.LEADING, TitledBorder.TOP, null, null)); GridBagConstraints gbc_modStereoWidthPanel = new GridBagConstraints(); gbc_modStereoWidthPanel.anchor = GridBagConstraints.NORTH; gbc_modStereoWidthPanel.insets = new Insets(0, 0, 5, 0); gbc_modStereoWidthPanel.fill = GridBagConstraints.HORIZONTAL; gbc_modStereoWidthPanel.gridx = 0; gbc_modStereoWidthPanel.gridy = 1; soundTab.add(modStereoWidthPanel, gbc_modStereoWidthPanel); modStereoWidthSlider = new JSlider(); modStereoWidthSlider.setPaintTicks(true); modStereoWidthSlider.setMinorTickSpacing(25); modStereoWidthPanel.add(modStereoWidthSlider); final JLabel modStereoWidthLbl = new JLabel("NN%"); modStereoWidthPanel.add(modStereoWidthLbl); JPanel bufferSizePanel = new JPanel(); FlowLayout flowLayout_3 = (FlowLayout) bufferSizePanel.getLayout(); flowLayout_3.setAlignment(FlowLayout.LEFT); bufferSizePanel.setBorder( new TitledBorder(null, "Buffer Size", TitledBorder.LEADING, TitledBorder.TOP, null, null)); GridBagConstraints gbc_bufferSizePanel = new GridBagConstraints(); gbc_bufferSizePanel.anchor = GridBagConstraints.NORTH; gbc_bufferSizePanel.insets = new Insets(0, 0, 5, 0); gbc_bufferSizePanel.fill = GridBagConstraints.HORIZONTAL; gbc_bufferSizePanel.gridx = 0; gbc_bufferSizePanel.gridy = 2; soundTab.add(bufferSizePanel, gbc_bufferSizePanel); audioBufferSizeCB = new JComboBox(); audioBufferSizeCB.setModel(new DefaultComboBoxModel(AudioBufferSize.values())); bufferSizePanel.add(audioBufferSizeCB); soundOutputSelectorGUI = new SoundOutputSelectorGUI(); soundOutputSelectorGUI.setBorder( new TitledBorder(null, "Output Driver", TitledBorder.LEADING, TitledBorder.TOP, null, null)); GridBagConstraints gbc_soundOutputSelectorGUI = new GridBagConstraints(); gbc_soundOutputSelectorGUI.anchor = GridBagConstraints.NORTH; gbc_soundOutputSelectorGUI.insets = new Insets(0, 0, 5, 0); gbc_soundOutputSelectorGUI.fill = GridBagConstraints.HORIZONTAL; gbc_soundOutputSelectorGUI.gridx = 0; gbc_soundOutputSelectorGUI.gridy = 3; soundTab.add(soundOutputSelectorGUI, gbc_soundOutputSelectorGUI); modStereoWidthSlider.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent arg0) { modStereoWidthLbl.setText(modStereoWidthSlider.getValue() + "%"); needRestart = true; } }); JPanel okCancelPanel = new JPanel(); getContentPane().add(okCancelPanel, BorderLayout.SOUTH); okCancelPanel.setLayout(new BorderLayout(0, 0)); JButton btnOk = new JButton("OK"); btnOk.setToolTipText("Apply these settings and close the window"); okCancelPanel.add(btnOk, BorderLayout.WEST); btnOk.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { applySettings(); ConfigWindow.this.setVisible(false); } }); JButton btnCancel = new JButton("Cancel"); btnCancel.setToolTipText("Close the window without applying settings"); okCancelPanel.add(btnCancel, BorderLayout.EAST); JLabel lblConfigpath = new JLabel(TRConfiguration.getConfigFilePath().getAbsolutePath()); lblConfigpath.setIcon(null); lblConfigpath.setToolTipText("Default config file path"); lblConfigpath.setHorizontalAlignment(SwingConstants.CENTER); lblConfigpath.setFont(new Font("Dialog", Font.BOLD, 6)); okCancelPanel.add(lblConfigpath, BorderLayout.CENTER); btnCancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { ConfigWindow.this.setVisible(false); } }); }
From source file:org.monkeys.gui.matcher.MatcherPanel.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 w w . ja v a2 s .c om*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { javax.swing.JSplitPane splitPane = new javax.swing.JSplitPane(); textPanel = new javax.swing.JPanel(); textHeader = new org.monkeys.gui.HeaderLabel(); javax.swing.JScrollPane textScroll = new javax.swing.JScrollPane(); textArea = new javax.swing.JTextArea(); editPanel = new javax.swing.JPanel(); clearButton = new javax.swing.JButton(); javax.swing.JSeparator jSeparator2 = new javax.swing.JSeparator(); editButton = new javax.swing.JToggleButton(); matchingPanel = new javax.swing.JPanel(); org.monkeys.gui.HeaderLabel matchingHeader = new org.monkeys.gui.HeaderLabel(); matchingScroll = new javax.swing.JScrollPane(); matchingList = new org.monkeys.gui.matcher.MatcherTable(); org.monkeys.gui.HeaderLabel categoryLabel = new org.monkeys.gui.HeaderLabel(); categoryDropdown = new org.monkeys.gui.CategoryDropdown(); clipboardButton = new javax.swing.JToggleButton(); selectButton = new javax.swing.JToggleButton(); removeDuplicateButton = new javax.swing.JButton(); removeRowButton = new javax.swing.JButton(); javax.swing.JSeparator jSeparator3 = new javax.swing.JSeparator(); javax.swing.JSeparator jSeparator4 = new javax.swing.JSeparator(); javax.swing.JSeparator jSeparator5 = new javax.swing.JSeparator(); modifyButton = new javax.swing.JButton(); javax.swing.JSeparator jSeparator6 = new javax.swing.JSeparator(); undoButton = new javax.swing.JButton(); javax.swing.JSeparator jSeparator7 = new javax.swing.JSeparator(); clipboardDropdown = new javax.swing.JComboBox(); splitPane.setBorder(null); splitPane.setDividerSize(8); splitPane.setResizeWeight(0.6); textHeader.setText("Text"); textScroll.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray)); textScroll.setMinimumSize(new java.awt.Dimension(200, 50)); textScroll.setPreferredSize(new java.awt.Dimension(300, 150)); textArea.setTabSize(4); textArea.setAutoscrolls(false); textScroll.setViewportView(textArea); clearButton .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/clear-20.png"))); // NOI18N clearButton.setText("Clear"); clearButton.setToolTipText("Clear All Fields"); clearButton.setBorderPainted(false); clearButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clearButtonActionPerformed(evt); } }); jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL); editButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/lock-18.png"))); // NOI18N editButton.setSelected(true); editButton.setText("Edit"); editButton.setToolTipText("Edit Text"); editButton.setBorderPainted(false); editButton.setDisabledIcon( new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/lock-18.png"))); // NOI18N editButton.setIconTextGap(3); editButton.setSelectedIcon( new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/unlock-18.png"))); // NOI18N editButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { editButtonActionPerformed(evt); } }); javax.swing.GroupLayout editPanelLayout = new javax.swing.GroupLayout(editPanel); editPanel.setLayout(editPanelLayout); editPanelLayout.setHorizontalGroup(editPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(editPanelLayout.createSequentialGroup().addComponent(editButton).addGap(0, 0, 0) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0).addComponent(clearButton).addGap(0, 89, Short.MAX_VALUE))); editPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { clearButton, editButton }); editPanelLayout.setVerticalGroup(editPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(editPanelLayout.createSequentialGroup().addGap(0, 0, 0) .addGroup(editPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSeparator2) .addComponent(editButton, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(clearButton, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, 0))); editPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { clearButton, editButton }); javax.swing.GroupLayout textPanelLayout = new javax.swing.GroupLayout(textPanel); textPanel.setLayout(textPanelLayout); textPanelLayout.setHorizontalGroup(textPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(textPanelLayout.createSequentialGroup() .addComponent(editPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(textPanelLayout.createSequentialGroup().addContainerGap() .addGroup(textPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(textScroll, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(textHeader, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); textPanelLayout.setVerticalGroup(textPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(textPanelLayout.createSequentialGroup().addContainerGap() .addComponent(textHeader, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(editPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE) .addContainerGap())); splitPane.setLeftComponent(textPanel); matchingHeader.setText("Matches"); matchingScroll.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray)); matchingScroll.setMinimumSize(new java.awt.Dimension(200, 120)); matchingScroll.setPreferredSize(new java.awt.Dimension(480, 300)); matchingScroll.setViewportView(matchingList); categoryLabel.setText("Category"); clipboardButton.setIcon( new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/clipboard-16.png"))); // NOI18N clipboardButton.setToolTipText("Copy Selected To Clipboard"); clipboardButton.setBorderPainted(false); clipboardButton.setEnabled(false); clipboardButton.setIconTextGap(2); clipboardButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { clipboardButtonActionPerformed(evt); } }); selectButton .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/list-16.png"))); // NOI18N selectButton.setToolTipText("Select / Unselect All"); selectButton.setBorderPainted(false); selectButton.setEnabled(false); selectButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectButtonActionPerformed(evt); } }); removeDuplicateButton.setIcon(new javax.swing.ImageIcon( getClass().getResource("/org/monkeys/gui/icons/remove-duplicates-16.png"))); // NOI18N removeDuplicateButton.setToolTipText("Remove Duplicates"); removeDuplicateButton.setBorderPainted(false); removeDuplicateButton.setEnabled(false); removeDuplicateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeDuplicateButtonActionPerformed(evt); } }); removeRowButton .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/remove-16.png"))); // NOI18N removeRowButton.setToolTipText("Remove Selected"); removeRowButton.setBorderPainted(false); removeRowButton.setEnabled(false); removeRowButton.setIconTextGap(2); removeRowButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeRowButtonActionPerformed(evt); } }); jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL); jSeparator4.setOrientation(javax.swing.SwingConstants.VERTICAL); jSeparator5.setOrientation(javax.swing.SwingConstants.VERTICAL); modifyButton .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/edit-16.png"))); // NOI18N modifyButton.setToolTipText("Edit Selected"); modifyButton.setBorderPainted(false); modifyButton.setEnabled(false); modifyButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { modifyButtonActionPerformed(evt); } }); jSeparator6.setOrientation(javax.swing.SwingConstants.VERTICAL); undoButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/monkeys/gui/icons/undo-16.png"))); // NOI18N undoButton.setBorderPainted(false); undoButton.setEnabled(false); undoButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { undoButtonActionPerformed(evt); } }); jSeparator7.setOrientation(javax.swing.SwingConstants.VERTICAL); clipboardDropdown.setEditable(true); clipboardDropdown.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); clipboardDropdown.setEnabled(false); javax.swing.GroupLayout matchingPanelLayout = new javax.swing.GroupLayout(matchingPanel); matchingPanel.setLayout(matchingPanelLayout); matchingPanelLayout.setHorizontalGroup(matchingPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(matchingPanelLayout.createSequentialGroup().addContainerGap() .addGroup(matchingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(matchingPanelLayout.createSequentialGroup().addComponent(selectButton) .addGap(0, 0, 0) .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0).addComponent(removeDuplicateButton).addGap(0, 0, 0) .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0).addComponent(removeRowButton).addGap(0, 0, 0) .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0).addComponent(modifyButton).addGap(0, 0, 0) .addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0).addComponent(undoButton).addGap(0, 0, 0) .addComponent(jSeparator7, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(clipboardDropdown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0).addComponent(clipboardButton) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(matchingScroll, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(categoryLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(categoryDropdown, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(matchingHeader, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); matchingPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { clipboardButton, modifyButton, removeRowButton }); matchingPanelLayout.setVerticalGroup(matchingPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(matchingPanelLayout.createSequentialGroup().addContainerGap() .addComponent(categoryLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(categoryDropdown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(matchingHeader, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(matchingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(matchingPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, matchingPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(removeDuplicateButton).addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(matchingPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(selectButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(jSeparator3, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(removeRowButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(modifyButton) .addGroup(matchingPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(clipboardButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(matchingPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(undoButton).addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jSeparator7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(clipboardDropdown, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(matchingScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE) .addContainerGap())); matchingPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { clipboardButton, clipboardDropdown }); splitPane.setRightComponent(matchingPanel); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(splitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 664, Short.MAX_VALUE) .addGap(0, 0, 0))); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(splitPane)); }
From source file:org.opendatakit.briefcase.ui.CharsetConverterDialog.java
/** * Create the dialog./* w ww.jav a 2 s. com*/ */ public CharsetConverterDialog(Window owner) { super(owner, ModalityType.DOCUMENT_MODAL); setTitle(DIALOG_TITLE); setBounds(100, 100, 600, 530); getContentPane().setLayout(new BorderLayout()); JPanel contentPanel = new JPanel(); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); GridBagLayout gbl_contentPanel = new GridBagLayout(); contentPanel.setLayout(gbl_contentPanel); { JLabel lblNewLabel = new JLabel(SELECT_FILE_LABEL); GridBagConstraints gbc_lblNewLabel = new GridBagConstraints(); gbc_lblNewLabel.anchor = GridBagConstraints.WEST; gbc_lblNewLabel.gridwidth = 2; gbc_lblNewLabel.insets = new Insets(0, 0, 5, 0); gbc_lblNewLabel.gridx = 0; gbc_lblNewLabel.gridy = 0; contentPanel.add(lblNewLabel, gbc_lblNewLabel); } { tfFile = new JTextField(); tfFile.setEditable(false); GridBagConstraints gbc_tfFile = new GridBagConstraints(); gbc_tfFile.weightx = 1.0; gbc_tfFile.insets = new Insets(0, 0, 5, 5); gbc_tfFile.fill = GridBagConstraints.HORIZONTAL; gbc_tfFile.gridx = 0; gbc_tfFile.gridy = 1; contentPanel.add(tfFile, gbc_tfFile); tfFile.setColumns(10); } { JButton btnBrowse = new JButton(SELECT_FILE_BUTTON); btnBrowse.setActionCommand(BROWSE_COMMAND); btnBrowse.addActionListener(this); GridBagConstraints gbc_btnBrowse = new GridBagConstraints(); gbc_btnBrowse.insets = new Insets(0, 0, 5, 0); gbc_btnBrowse.gridx = 1; gbc_btnBrowse.gridy = 1; contentPanel.add(btnBrowse, gbc_btnBrowse); } { JLabel lblEncoding = new JLabel(SELECT_SOURCE_ENCODING_LABEL); GridBagConstraints gbc_lblEncoding = new GridBagConstraints(); gbc_lblEncoding.anchor = GridBagConstraints.WEST; gbc_lblEncoding.insets = new Insets(0, 0, 5, 5); gbc_lblEncoding.gridx = 0; gbc_lblEncoding.gridy = 2; contentPanel.add(lblEncoding, gbc_lblEncoding); } { listCharset = new JList<CharsetEntry>(); listCharset.setVisibleRowCount(7); listCharset.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); GridBagConstraints gbc_cbCharset = new GridBagConstraints(); gbc_cbCharset.gridwidth = 2; gbc_cbCharset.insets = new Insets(0, 0, 5, 0); gbc_cbCharset.fill = GridBagConstraints.BOTH; gbc_cbCharset.gridx = 0; gbc_cbCharset.gridy = 3; JScrollPane listScrollPane = new JScrollPane(listCharset); contentPanel.add(listScrollPane, gbc_cbCharset); } { JLabel lblPreview = new JLabel(PREVIEW_LABEL); GridBagConstraints gbc_lblPreview = new GridBagConstraints(); gbc_lblPreview.anchor = GridBagConstraints.WEST; gbc_lblPreview.insets = new Insets(0, 0, 5, 5); gbc_lblPreview.gridx = 0; gbc_lblPreview.gridy = 4; contentPanel.add(lblPreview, gbc_lblPreview); } { JScrollPane scrollPane = new JScrollPane(); GridBagConstraints gbc_scrollPane = new GridBagConstraints(); gbc_scrollPane.weighty = 1.0; gbc_scrollPane.weightx = 1.0; gbc_scrollPane.gridwidth = 2; gbc_scrollPane.fill = GridBagConstraints.BOTH; gbc_scrollPane.gridx = 0; gbc_scrollPane.gridy = 5; contentPanel.add(scrollPane, gbc_scrollPane); { previewArea = new JTextArea(); previewArea.setLineWrap(true); previewArea.setRows(10); previewArea.setFont(UIManager.getDefaults().getFont("Label.font").deriveFont(Font.PLAIN)); previewArea.setEditable(false); scrollPane.setViewportView(previewArea); } } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { cbOverride = new JCheckBox(REPLACE_EXISTING_FILE_LABEL); cbOverride.setSelected(false); buttonPane.add(cbOverride); } { JButton okButton = new JButton(CONVERT_BUTTON_LABEL); okButton.setActionCommand(CONVERT_COMMAND); okButton.addActionListener(this); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } { cancelButton = new JButton(CANCEL_BUTTON_LABEL); cancelButton.setActionCommand(CANCEL_COMMAND); cancelButton.addActionListener(this); buttonPane.add(cancelButton); } } }
From source file:org.ops4j.pax.idea.runner.forms.OsgiConfigEditorForm.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection HardCodedStringLiteral// www.ja va 2s. co m */ private void $$$setupUI$$$() { m_mainPanel = new JPanel(); m_mainPanel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); final JPanel panel1 = new JPanel(); panel1.setLayout(new GridLayoutManager(7, 1, new Insets(0, 0, 0, 0), -1, -1)); m_mainPanel.add(panel1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final JPanel panel2 = new JPanel(); panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); panel1.add(panel2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); panel2.setBorder(BorderFactory.createTitledBorder("Platform")); final JScrollPane scrollPane1 = new JScrollPane(); panel2.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); m_platforms = new JList(); scrollPane1.setViewportView(m_platforms); final JPanel panel3 = new JPanel(); panel3.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1)); panel1.add(panel3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); panel3.setBorder(BorderFactory.createTitledBorder("Options")); m_startGui = new JCheckBox(); m_startGui.setText("Start GUI"); panel3.add(m_startGui, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); m_runClean = new JCheckBox(); m_runClean.setText("Run Clean"); panel3.add(m_runClean, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JScrollPane scrollPane2 = new JScrollPane(); panel1.add(scrollPane2, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); scrollPane2.setBorder(BorderFactory.createTitledBorder("System Properties")); m_systemProperties = new JTable(); m_systemProperties.setEnabled(true); scrollPane2.setViewportView(m_systemProperties); final JPanel panel4 = new JPanel(); panel4.setLayout(new GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1)); panel1.add(panel4, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); panel4.setBorder(BorderFactory.createTitledBorder("Proxy")); final JLabel label1 = new JLabel(); label1.setText("Port:"); panel4.add(label1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label2 = new JLabel(); label2.setText("Username:"); panel4.add(label2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label3 = new JLabel(); label3.setText("Password:"); panel4.add(label3, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); m_proxyHost = new JTextField(); panel4.add(m_proxyHost, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); m_proxyPort = new JTextField(); panel4.add(m_proxyPort, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); m_proxyUser = new JTextField(); panel4.add(m_proxyUser, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); m_proxyPass = new JPasswordField(); panel4.add(m_proxyPass, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final JLabel label4 = new JLabel(); label4.setHorizontalAlignment(10); label4.setHorizontalTextPosition(10); label4.setText("Host:"); panel4.add(label4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JPanel panel5 = new JPanel(); panel5.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); panel1.add(panel5, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final JLabel label5 = new JLabel(); label5.setText("Working Dir:"); panel5.add(label5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); m_workDir = new JTextField(); panel5.add(m_workDir, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); m_selectDir = new JButton(); m_selectDir.setText("..."); panel5.add(m_selectDir, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JPanel panel6 = new JPanel(); panel6.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); panel1.add(panel6, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final JLabel label6 = new JLabel(); label6.setText("VM Arguments:"); panel6.add(label6, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); m_vmArguments = new JTextField(); panel6.add(m_vmArguments, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final JPanel panel7 = new JPanel(); panel7.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); panel1.add(panel7, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final JLabel label7 = new JLabel(); label7.setText("JDK:"); panel7.add(label7, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); m_jdk = new JTextField(); m_jdk.setEditable(false); panel7.add(m_jdk, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final JPanel panel8 = new JPanel(); panel8.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1)); m_mainPanel.add(panel8, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); panel8.setBorder(BorderFactory.createTitledBorder("Bundles")); final JPanel panel9 = new JPanel(); panel9.setLayout(new GridLayoutManager(1, 5, new Insets(0, 0, 0, 0), -1, -1)); panel8.add(panel9, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); JButton add = new JButton(); add.setText("Add..."); panel9.add(add, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JScrollPane scrollPane3 = new JScrollPane(); panel8.add(scrollPane3, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); scrollPane3.setBorder(BorderFactory.createTitledBorder("Properties")); m_bundleProperties = new JTable(); scrollPane3.setViewportView(m_bundleProperties); final JScrollPane scrollPane4 = new JScrollPane(); panel8.add(scrollPane4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); m_bundles = new JList(); scrollPane4.setViewportView(m_bundles); final JPanel panel10 = new JPanel(); panel10.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); panel8.add(panel10, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); panel10.setBorder(BorderFactory.createTitledBorder("Description")); m_description = new JTextArea(); panel10.add(m_description, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false)); }
From source file:org.ow2.aspirerfid.demos.warehouse.management.UI.WarehouseManagement.java
/** * Initialize the contents of the frame// w w w .ja va 2 s.c om */ private void initialize() { final JTabbedPane tabbedPane; final JPanel deliveryPanel; final JLabel entryDateLabel; final JLabel entryDateLabel_1; final JLabel entryDateLabel_2; final JLabel entryDateLabel_3; final JLabel entryDateLabel_3_1; final JLabel entryDateLabel_3_2; final JPanel shipmentPanel; final JLabel entryDateLabel_3_1_1; final JLabel entryDateLabel_3_1_2; final JScrollPane scrollPane; final JButton printReportButton; final JButton saveReportButton; final JButton activateDoorButton; final JButton deactivateDoorButton; final JButton clearReportButton; final JPanel panel; final JLabel entryDateLabel_3_3; final JLabel entryDateLabel_2_1; frame = new JFrame(); frame.getContentPane().setLayout(new BorderLayout()); frame.setTitle("Warehouse Management"); frame.setBounds(100, 100, 1011, 625); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); tabbedPane = new JTabbedPane(); frame.getContentPane().add(tabbedPane); deliveryPanel = new JPanel(); deliveryPanel.setLayout(null); tabbedPane.addTab("Delivery Counter", null, deliveryPanel, null); entryDateLabel = new JLabel(); entryDateLabel.setText("Entry Date ........."); entryDateLabel.setBounds(533, 23, 117, 16); deliveryPanel.add(entryDateLabel); entryDateLabel_1 = new JLabel(); entryDateLabel_1.setText("User ID ................"); entryDateLabel_1.setBounds(10, 94, 117, 16); deliveryPanel.add(entryDateLabel_1); entryDateLabel_2 = new JLabel(); entryDateLabel_2.setText("Invoice ID ............"); entryDateLabel_2.setBounds(10, 23, 117, 16); deliveryPanel.add(entryDateLabel_2); entryDateLabel_3 = new JLabel(); entryDateLabel_3.setText("Warehouse ID...."); entryDateLabel_3.setBounds(10, 45, 117, 16); deliveryPanel.add(entryDateLabel_3); entryDateLabel_3_1 = new JLabel(); entryDateLabel_3_1.setText("Zone ID ................"); entryDateLabel_3_1.setBounds(10, 67, 117, 16); deliveryPanel.add(entryDateLabel_3_1); entryDateLabel_3_2 = new JLabel(); entryDateLabel_3_2.setText("Entry Hour ........."); entryDateLabel_3_2.setBounds(533, 45, 117, 16); deliveryPanel.add(entryDateLabel_3_2); entryDateLabel_3_1_1 = new JLabel(); entryDateLabel_3_1_1.setText("Offering Date ...."); entryDateLabel_3_1_1.setBounds(533, 70, 117, 16); deliveryPanel.add(entryDateLabel_3_1_1); entryDateLabel_3_1_2 = new JLabel(); entryDateLabel_3_1_2.setText("Offering Hour ...."); entryDateLabel_3_1_2.setBounds(533, 94, 117, 16); deliveryPanel.add(entryDateLabel_3_1_2); invoiceIDTextField = new JTextField(); invoiceIDTextField.setBounds(105, 19, 365, 20); deliveryPanel.add(invoiceIDTextField); warehouseIDTextField = new JTextField(); warehouseIDTextField.setBounds(105, 43, 365, 20); deliveryPanel.add(warehouseIDTextField); zoneIDTextField = new JTextField(); zoneIDTextField.setBounds(105, 66, 365, 20); deliveryPanel.add(zoneIDTextField); userIDTextField = new JTextField(); userIDTextField.setBounds(105, 90, 365, 20); deliveryPanel.add(userIDTextField); entryDateTextField = new JTextField(); entryDateTextField.setBounds(623, 19, 365, 20); deliveryPanel.add(entryDateTextField); entryHourTextField = new JTextField(); entryHourTextField.setBounds(623, 41, 365, 20); deliveryPanel.add(entryHourTextField); offeringDateTextField = new JTextField(); offeringDateTextField.setBounds(623, 66, 365, 20); deliveryPanel.add(offeringDateTextField); offeringHourTextField = new JTextField(); offeringHourTextField.setBounds(623, 90, 365, 20); deliveryPanel.add(offeringHourTextField); scrollPane = new JScrollPane(); scrollPane.setBounds(10, 129, 978, 355); deliveryPanel.add(scrollPane); deliveryTableModel = new DefaultTableModel();// All Clients Items deliveryTableModel.addColumn("Company"); deliveryTableModel.addColumn("Item Code"); deliveryTableModel.addColumn("Description"); deliveryTableModel.addColumn("Quantity Delivered"); deliveryTableModel.addColumn("Expected Quantity"); deliveryTableModel.addColumn("Quantity Remain"); deliveryTableModel.addColumn("Delivery Date"); deliveryTableModel.addColumn("Measurement ID"); deliveryTableModel.addColumn("Quantity"); deliveryTable = new JTable(deliveryTableModel); deliveryTable.setFont(new Font("Arial Narrow", Font.PLAIN, 10)); deliveryTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scrollPane.setViewportView(deliveryTable); ListSelectionModel rowSM = deliveryTable.getSelectionModel(); printReportButton = new JButton(); printReportButton.setText("Print Report"); printReportButton.setBounds(860, 520, 117, 26); deliveryPanel.add(printReportButton); saveReportButton = new JButton(); saveReportButton.setText("Save Report"); saveReportButton.setBounds(614, 520, 117, 26); deliveryPanel.add(saveReportButton); activateDoorButton = new JButton(); activateDoorButton.addMouseListener(new ActivateDoorButtonMouseListener()); activateDoorButton.setText("Activate Door"); activateDoorButton.setBounds(50, 520, 117, 26); deliveryPanel.add(activateDoorButton); deactivateDoorButton = new JButton(); deactivateDoorButton.addMouseListener(new DeactivateDoorButtonMouseListener()); deactivateDoorButton.setText("Dectivate Door"); deactivateDoorButton.setBounds(173, 520, 117, 26); deliveryPanel.add(deactivateDoorButton); clearReportButton = new JButton(); clearReportButton.addMouseListener(new ClearReportButtonMouseListener()); clearReportButton.setText("Clear Report"); clearReportButton.setBounds(737, 520, 117, 26); deliveryPanel.add(clearReportButton); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { // Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel) e.getSource(); if (lsm.isSelectionEmpty()) { // no rows are selected } else { selectedRow = lsm.getMinSelectionIndex(); System.out.println("selectedRow = " + selectedRow); } } }); shipmentPanel = new JPanel(); tabbedPane.addTab("Shipment", null, shipmentPanel, null); panel = new JPanel(); panel.setLayout(null); tabbedPane.addTab("Door Config", null, panel, null); aleListeningPortTextField = new JTextField(); aleListeningPortTextField.setText("9999"); aleListeningPortTextField.setBounds(172, 41, 330, 20); panel.add(aleListeningPortTextField); epcisRepositoryURLTextField = new JTextField(); epcisRepositoryURLTextField.setText("http://localhost:8080/aspire0.3.0EpcisRepository/capture"); epcisRepositoryURLTextField.setBounds(172, 65, 330, 20); panel.add(epcisRepositoryURLTextField); entryDateLabel_3_3 = new JLabel(); entryDateLabel_3_3.setText("EPCIS Rep. URL ........."); entryDateLabel_3_3.setBounds(51, 67, 117, 16); panel.add(entryDateLabel_3_3); entryDateLabel_2_1 = new JLabel(); entryDateLabel_2_1.setText("ALE Listening Port ...."); entryDateLabel_2_1.setBounds(51, 43, 117, 16); panel.add(entryDateLabel_2_1); }
From source file:org.ow2.aspirerfid.demos.warehouse.management.UI.WMS.java
/** * Initialize the contents of the frame/*from ww w . j a v a2 s .c o m*/ */ private void initialize() { final JLabel entryDateLabel_2; final JLabel entryDateLabel_3_1_1; final JScrollPane scrollPane; final JButton printReportButton; final JButton saveReportButton; final JButton clearReportButton; frame = new JFrame(); frame.setResizable(false); frame.addWindowListener(new FrameWindowListener()); frame.getContentPane().setLayout(new BorderLayout()); frame.setTitle("Warehouse Management"); frame.setBounds(100, 100, 757, 625); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); tabbedPane = new JTabbedPane(); frame.getContentPane().add(tabbedPane); deliveryTableModel = new DefaultTableModel();// All Clients Items deliveryTableModel.addColumn("Company"); deliveryTableModel.addColumn("Item Code"); deliveryTableModel.addColumn("Description"); deliveryTableModel.addColumn("Quantity Delivered"); deliveryTableModel.addColumn("Expected Quantity"); deliveryTableModel.addColumn("Quantity Remain"); deliveryTableModel.addColumn("Delivery Date"); deliveryTableModel.addColumn("Measurement ID"); deliveryInfoModel = new DefaultTableModel();// All Clients Items deliveryInfoModel.addColumn("Company"); deliveryInfoModel.addColumn("Item Code"); deliveryInfoModel.addColumn("Description"); deliveryInfoModel.addColumn("Expected Quantity"); deliveryInfoModel.addColumn("Measurement ID"); shipmentPanel = new JPanel(); shipmentPanel.setLayout(null); tabbedPane.addTab("Shipment", null, shipmentPanel, null); submitShipmentButton = new JButton(); submitShipmentButton.addActionListener(new SubmitShipmentButtonActionListener()); submitShipmentButton.setText("Submit"); submitShipmentButton.setBounds(275, 89, 112, 25); shipmentPanel.add(submitShipmentButton); final JLabel selectAvaiableInvoiceLabel = new JLabel(); selectAvaiableInvoiceLabel.setText("Select avaiable invoice to track"); selectAvaiableInvoiceLabel.setBounds(58, 26, 195, 15); shipmentPanel.add(selectAvaiableInvoiceLabel); shipmentsCb = new JComboBox(); shipmentsCb.setModel(new DefaultComboBoxModel(new String[] {})); shipmentsCb.setSelectedItem(null); shipmentsCb.addActionListener(new ShipmentsCbActionListener()); shipmentsCb.setBounds(269, 21, 382, 24); shipmentPanel.add(shipmentsCb); final JPanel panel = new JPanel(); panel.setLayout(null); panel.setBorder(new TitledBorder(null, "Shipment information", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null)); panel.setBounds(10, 170, 722, 327); shipmentPanel.add(panel); final JScrollPane scrollPane_1 = new JScrollPane(); scrollPane_1.setBounds(10, 27, 702, 300); panel.add(scrollPane_1); deliveryInfo = new JTable(deliveryInfoModel); deliveryInfo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scrollPane_1.setViewportView(deliveryInfo); deliveryPanel = new JPanel(); deliveryPanel.setLayout(null); tabbedPane.addTab("Delivery Counter", null, deliveryPanel, null); entryDateLabel_2 = new JLabel(); entryDateLabel_2.setText("Invoice ID "); entryDateLabel_2.setBounds(10, 23, 117, 16); deliveryPanel.add(entryDateLabel_2); entryDateLabel_3_1_1 = new JLabel(); entryDateLabel_3_1_1.setText("Offering Date"); entryDateLabel_3_1_1.setBounds(391, 25, 117, 16); deliveryPanel.add(entryDateLabel_3_1_1); invoiceIDTextField = new JTextField(); invoiceIDTextField.setEditable(false); invoiceIDTextField.setBounds(105, 21, 270, 20); deliveryPanel.add(invoiceIDTextField); offeringDateTextField = new JTextField(); offeringDateTextField.setEditable(false); offeringDateTextField.setBounds(511, 23, 230, 20); deliveryPanel.add(offeringDateTextField); scrollPane = new JScrollPane(); scrollPane.setBounds(10, 81, 731, 403); deliveryPanel.add(scrollPane); deliveryTable = new JTable(deliveryTableModel); deliveryTable.setFont(new Font("Arial Narrow", Font.PLAIN, 10)); deliveryTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scrollPane.setViewportView(deliveryTable); printReportButton = new JButton(); printReportButton.setText("Print Report"); printReportButton.setBounds(459, 520, 117, 26); deliveryPanel.add(printReportButton); saveReportButton = new JButton(); saveReportButton.setText("Save Report"); saveReportButton.setBounds(213, 520, 117, 26); deliveryPanel.add(saveReportButton); clearReportButton = new JButton(); clearReportButton.addMouseListener(new ClearReportButtonMouseListener()); clearReportButton.setText("Clear Report"); clearReportButton.setBounds(336, 520, 117, 26); deliveryPanel.add(clearReportButton); }
From source file:org.p_vcd.ui.LicenseDialog.java
public LicenseDialog(String libName, String libHomepage, String licenseName, String licenseFilename) { setSize(680, 480);/*from w w w. ja va2 s . co m*/ setTitle(libName); getContentPane().setLayout(new BorderLayout()); { JPanel panel = new JPanel(); getContentPane().add(panel, BorderLayout.NORTH); panel.setLayout(new MigLayout("", "[grow,trailing][grow]", "[20px][][]")); { JLabel lblSoft = new JLabel(libName); lblSoft.setFont(new Font("Tahoma", Font.BOLD, 16)); panel.add(lblSoft, "center,cell 0 0 2 1"); } { JLabel lblHomePage = new JLabel("Home page:"); lblHomePage.setFont(new Font("Tahoma", Font.BOLD, 14)); panel.add(lblHomePage, "cell 0 1"); } { JLabel lblHome = SwingUtil.createLink(libHomepage, libHomepage); lblHome.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel.add(lblHome, "cell 1 1"); } { JLabel lblNewLabel = new JLabel("License:"); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 14)); panel.add(lblNewLabel, "cell 0 2"); } { JLabel lblLicense = new JLabel(licenseName); lblLicense.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel.add(lblLicense, "cell 1 2"); } } { JPanel panel = new JPanel(); getContentPane().add(panel, BorderLayout.CENTER); panel.setLayout(new FlowLayout()); panel.setBorder(new EmptyBorder(5, 5, 5, 5)); JScrollPane scrollPane = new JScrollPane(); scrollPane.setPreferredSize(new Dimension(600, 300)); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); panel.add(scrollPane); { JTextArea txtLicense = new JTextArea(); txtLicense.setEditable(false); txtLicense.setFont(new Font("Monospaced", Font.PLAIN, 11)); txtLicense.setWrapStyleWord(true); txtLicense.setLineWrap(true); try { InputStream is = Thread.currentThread().getContextClassLoader() .getResourceAsStream("org/p_vcd/licenses/" + licenseFilename); String text = IOUtils.toString(is, "UTF-8"); IOUtils.closeQuietly(is); txtLicense.setText(text); txtLicense.setCaretPosition(0); } catch (Exception e) { e.printStackTrace(); } scrollPane.setViewportView(txtLicense); } } { JPanel panel = new JPanel(); getContentPane().add(panel, BorderLayout.SOUTH); panel.setLayout(new FlowLayout(FlowLayout.CENTER)); JButton okButton = new JButton("OK"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { LicenseDialog.this.dispose(); } }); okButton.setActionCommand("OK"); panel.add(okButton); getRootPane().setDefaultButton(okButton); } }
From source file:org.p_vcd.ui.VcdDialog.java
public VcdDialog() { setSize(700, 450);// w w w. j av a2s. c om setTitle("P-VCD - Video Copy Detection"); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.currentStep = 1; getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLayout(new CardLayout(0, 0)); { JPanel panel_Step1 = new JPanel(); contentPanel.add(panel_Step1, "card_step1"); panel_Step1.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 1 - Video Database (the \"known\")"); panel_Step1.add(lblTitle, BorderLayout.NORTH); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); JPanel panel_1 = new JPanel(); panel_Step1.add(panel_1, BorderLayout.CENTER); panel_1.setLayout(new MigLayout("", "[250px,grow][20px][250px,grow]", "[][][230px,grow][][][]")); JLabel lblNewLabel = new JLabel("Please select the video databases to search in:"); panel_1.add(lblNewLabel, "cell 0 0"); panel_1.add(lbl_refDbTitle, "cell 2 1"); JScrollPane scrollPane_1 = new JScrollPane(); panel_1.add(scrollPane_1, "cell 0 1 1 3,grow"); panel_refDatabasesList.setBackground(Color.WHITE); scrollPane_1.setViewportView(panel_refDatabasesList); panel_refDatabasesList.setLayout(new MigLayout("gapy 10", "[200px]", "[][]")); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBorder(null); panel_1.add(scrollPane, "cell 2 2,grow"); scrollPane.setViewportView(lbl_refDbFiles); panel_1.add(lbl_refDbMetadata, "cell 2 3"); JButton btnNewDatabase = new JButton("New database..."); panel_1.add(btnNewDatabase, "cell 0 4"); btnNewDatabase.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { newDatabaseButton(); } }); } { JPanel panel_Step2 = new JPanel(); contentPanel.add(panel_Step2, "card_step2"); panel_Step2.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 2 - Query (the \"unknown\")"); panel_Step2.add(lblTitle, BorderLayout.NORTH); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); JPanel panel = new JPanel(); panel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Query", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel_Step2.add(panel, BorderLayout.CENTER); panel.setLayout( new MigLayout("", "[160px][grow]", "[25px][grow,top][25px][grow,top][25px][grow,top][grow]")); ButtonGroup queryButtonGroup = new ButtonGroup(); queryButtonGroup.add(radio_queryFile); radio_queryFile.setFont(new Font("Tahoma", Font.PLAIN, 13)); panel.add(radio_queryFile, "cell 0 0"); lbl_queryFile.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { radio_queryFile.setSelected(true); } }); panel.add(lbl_queryFile, "flowy,cell 1 0"); JButton btnSelectFile = new JButton("Select File..."); btnSelectFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { selectFileButton(); } }); panel.add(btnSelectFile, "cell 1 0"); JLabel lblIumageOrVideo = new JLabel("Select an image or video in the local machine."); panel.add(lblIumageOrVideo, "cell 1 1"); queryButtonGroup.add(radio_queryUrl); radio_queryUrl.setFont(new Font("Tahoma", Font.PLAIN, 13)); panel.add(radio_queryUrl, "cell 0 2"); txt_queryUrl.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { radio_queryUrl.setSelected(true); } }); txt_queryUrl.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { radio_queryUrl.setSelected(true); } }); txt_queryUrl.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { radio_queryUrl.setSelected(true); } }); txt_queryUrl.setText("http://"); panel.add(txt_queryUrl, "flowy,cell 1 2"); txt_queryUrl.setColumns(50); JLabel lblUrlToA = new JLabel( "<html>Enter the URL to download an image or video.<br>You can use a URL like: http://www.youtube.com/watch?v=... </html>"); panel.add(lblUrlToA, "flowy,cell 1 3"); queryButtonGroup.add(radio_queryDb); radio_queryDb.setFont(new Font("Tahoma", Font.PLAIN, 13)); panel.add(radio_queryDb, "cell 0 4"); comboBox_queryDb.setMaximumRowCount(12); comboBox_queryDb.setPreferredSize(new Dimension(100, 20)); comboBox_queryDb.setMinimumSize(new Dimension(100, 20)); comboBox_queryDb.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (comboBox_queryDb.getSelectedIndex() > 0) radio_queryDb.setSelected(true); updateQueryDbDetail(); } }); comboBox_queryDb.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (comboBox_queryDb.getSelectedIndex() > 0) radio_queryDb.setSelected(true); updateQueryDbDetail(); } }); panel.add(comboBox_queryDb, "flowx,cell 1 4"); panel.add(lbl_queryDb, "cell 1 4"); JLabel lblPleaseNopteThe = new JLabel("<html>A search is run for each video in the database.</html>"); panel.add(lblPleaseNopteThe, "cell 1 5"); } { JPanel panel_Step3 = new JPanel(); contentPanel.add(panel_Step3, "card_step3"); panel_Step3.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 3 - Search Options"); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); panel_Step3.add(lblTitle, BorderLayout.NORTH); JPanel panel2 = new JPanel(); panel2.setLayout(new FlowLayout()); panel_Step3.add(panel2, BorderLayout.CENTER); JPanel panel = new JPanel(); panel2.add(panel); panel.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Basic Options", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel.setLayout(new MigLayout("gapy 5px", "[30px][101px]", "[][][][][][][20px]")); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(radio_searchByGlobal); radio_searchByGlobal.setFont(new Font("Tahoma", Font.PLAIN, 13)); radio_searchByGlobal.setSelected(true); panel.add(radio_searchByGlobal, "cell 0 0 2 1,alignx left,aligny top"); JLabel lblNewLabel_2 = new JLabel( "Detects most of the copies that are visually alike to the original."); panel.add(lblNewLabel_2, "cell 1 1"); JButton btnOptions = new JButton("Advanced Options..."); btnOptions.setEnabled(false); panel.add(btnOptions, "cell 1 2"); buttonGroup.add(radio_searchByLocal); radio_searchByLocal.setFont(new Font("Tahoma", Font.PLAIN, 13)); panel.add(radio_searchByLocal, "cell 0 4 2 1,alignx left,aligny top"); JLabel lblNewLabel_3 = new JLabel( "Requires more resources (disk space, search time, memory) but can detect more copies."); panel.add(lblNewLabel_3, "cell 1 5"); JButton btnOptions_1 = new JButton("Advanced Options..."); btnOptions_1.setEnabled(false); panel.add(btnOptions_1, "cell 1 6"); } { JPanel panel_Step4 = new JPanel(); contentPanel.add(panel_Step4, "card_step4"); panel_Step4.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 4 - Search"); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); panel_Step4.add(lblTitle, BorderLayout.NORTH); JScrollPane scrollPane = new JScrollPane(); panel_Step4.add(scrollPane, BorderLayout.CENTER); textConsole.setFont(new Font("Monospaced", Font.PLAIN, 11)); textConsole.setForeground(Color.WHITE); textConsole.setBackground(Color.BLACK); textConsole.setEditable(false); textConsole.setCursor(new Cursor(Cursor.TEXT_CURSOR)); textConsole.setText( "Press 'Next' button to start the search...\nNote: Depending on the selected options, the search may take up to several hours."); scrollPane.setViewportView(textConsole); JPanel panel = new JPanel(); panel_Step4.add(panel, BorderLayout.SOUTH); panel.setLayout(new GridLayout(0, 1, 0, 0)); JSeparator separator = new JSeparator(); separator.setPreferredSize(new Dimension(0, 1)); panel.add(separator); progressBar.setStringPainted(true); progressBar.setPreferredSize(new Dimension(350, 20)); panel.add(progressBar); lblProgress.setHorizontalAlignment(SwingConstants.CENTER); lblProgress.setFont(new Font("Tahoma", Font.PLAIN, 14)); panel.add(lblProgress); } { JPanel panel_Step5 = new JPanel(); contentPanel.add(panel_Step5, "card_step5"); panel_Step5.setLayout(new BorderLayout(0, 0)); JLabel lblTitle = new JLabel("STEP 5 - Results"); lblTitle.setHorizontalAlignment(SwingConstants.CENTER); lblTitle.setFont(new Font("Tahoma", Font.PLAIN, 18)); panel_Step5.add(lblTitle, BorderLayout.NORTH); JScrollPane scrollPane = new JScrollPane(); panel_Step5.add(scrollPane, BorderLayout.CENTER); scrollPane.setViewportView(panelResults); panelResults.setLayout(new MigLayout("gapy 10, gapx 20", "[120px,center][150px,center,grow][150px,center,grow]", "[25px][]")); } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton prevButton = new JButton("Previous"); prevButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { previousButton(); } }); prevButton.setActionCommand("Previous"); buttonPane.add(prevButton); } { JButton okButton = new JButton("Next"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { nextButton(); } }); okButton.setActionCommand("OK"); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } { JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelButton(); } }); cancelButton.setActionCommand("Cancel"); buttonPane.add(cancelButton); } } this.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { closeWindow(); } }); updateDatabases(null); }