List of usage examples for javax.swing JLabel setText
@BeanProperty(preferred = true, visualUpdate = true, description = "Defines the single line of text this component will display.") public void setText(String text)
From source file:org.openmicroscopy.shoola.util.ui.filechooser.CustomizedFileChooser.java
/** Builds and lays out the GUI. */ private void buildGUI() { setControlButtonsAreShown(nameArea == null); JLabel label; List<FileFilter> filters = model.getFilters(); if (filters != null) { for (FileFilter filter : filters) addChoosableFileFilter(filter); if (!isAcceptAllFileFilterUsed()) setFileFilter(filters.get(0)); }//from ww w . ja va2 s . c om if (isAcceptAllFileFilterUsed()) setFileFilter(getAcceptAllFileFilter()); try { File f = UIUtilities.getDefaultFolder(); if (f != null) setCurrentDirectory(f); } catch (Exception ex) { } switch (model.getChooserType()) { case FileChooser.SAVE: setDialogType(SAVE_DIALOG); setFileSelectionMode(FILES_ONLY); break; case FileChooser.IMPORT: setDialogType(SAVE_DIALOG); setFileSelectionMode(FILES_AND_DIRECTORIES); setMultiSelectionEnabled(true); break; case FileChooser.LOAD: label = (JLabel) UIUtilities.findComponent(this, JLabel.class); if (label != null) label.setText(LOAD_LABEL); setFileSelectionMode(FILES_ONLY); break; case FileChooser.FOLDER_CHOOSER: label = (JLabel) UIUtilities.findComponent(this, JLabel.class); if (label != null) label.setText(FOLDER_LABEL); setFileSelectionMode(DIRECTORIES_ONLY); setCurrentDirectory(getFileSystemView().getHomeDirectory()); } }
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//w w w.j a va 2 s . c om */ 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 . j av a 2 s . co m*/ */ 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//w w w . ja v a 2 s . co 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.parosproxy.paros.view.FindDialog.java
/** * This method initializes jPanel //from w ww . j a v a2 s .c om * * @return javax.swing.JPanel */ private JPanel getJPanel() { if (jPanel == null) { java.awt.GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); java.awt.GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); java.awt.GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); javax.swing.JLabel jLabel = new JLabel(); jPanel = new JPanel(); jPanel.setLayout(new GridBagLayout()); jLabel.setText(Constant.messages.getString("edit.find.label.what")); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 0; gridBagConstraints1.insets = new java.awt.Insets(2, 10, 2, 10); gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints5.weightx = 1.0; gridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints5.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints5.gridx = 1; gridBagConstraints5.gridy = 0; gridBagConstraints5.insets = new java.awt.Insets(12, 2, 8, 10); gridBagConstraints5.ipadx = 50; gridBagConstraints5.gridwidth = 2; gridBagConstraints6.gridwidth = 3; gridBagConstraints6.gridx = 0; gridBagConstraints6.gridy = 1; gridBagConstraints6.insets = new java.awt.Insets(2, 2, 2, 2); jPanel.add(jLabel, gridBagConstraints1); jPanel.add(getTxtFind(), gridBagConstraints5); jPanel.add(getJPanel1(), gridBagConstraints6); } return jPanel; }
From source file:org.pentaho.reporting.designer.extensions.pentaho.repository.util.RepositoryTreeCellRenderer.java
public Component getTreeCellRendererComponent(final JTree tree, final Object value, final boolean sel, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { final JLabel component = (JLabel) super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);/* w w w . j a v a 2 s . c om*/ if (value instanceof FileObject) { final FileObject node = (FileObject) value; try { if (leaf && (node.getType() == FileType.FOLDER)) { component.setIcon(getOpenIcon()); } } catch (FileSystemException fse) { // ignore exception here } component.setText(node.getName().getBaseName()); } else { component.setText("/"); component.setIcon(getOpenIcon()); } return component; }
From source file:org.rdv.ui.channel.LocalChannelDialog.java
/** * Initialize the UI components.// w w w. ja v a 2 s . co m */ private void initComponents() { RDV rdv = RDV.getInstance(RDV.class); JPanel container = new JPanel(); setContentPane(container); container.setLayout(new GridBagLayout()); GridBagConstraints c = createDefaultGridBagConstraints(); JLabel nameLabel = new JLabel(); nameLabel.setName("nameLabel"); nameLabel.setText(PROPERTY_REPO.getValue(NAME_KEY)); c = createDefaultGridBagConstraints(); c.fill = GridBagConstraints.NONE; c.gridx = 0; c.gridy = 1; c.gridwidth = 1; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new java.awt.Insets(10, 10, 10, 5); container.add(nameLabel, c); c = createDefaultGridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1; c.gridx = 1; c.gridy = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new java.awt.Insets(10, 0, 10, 10); container.add(nameTextField, c); if (isChannelUpdateOperation()) { nameTextField.setEnabled(false); } JLabel unitLabel = new JLabel(); unitLabel.setName("unitLabel"); unitLabel.setText(PROPERTY_REPO.getValue(UNIT_KEY)); c = createDefaultGridBagConstraints(); c.fill = GridBagConstraints.NONE; c.weightx = 0; c.gridx = 0; c.gridy = 2; c.gridwidth = 1; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new java.awt.Insets(0, 10, 10, 5); container.add(unitLabel, c); c = createDefaultGridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1; c.gridx = 1; c.gridy = 2; c.gridwidth = GridBagConstraints.REMAINDER; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new java.awt.Insets(0, 0, 10, 10); container.add(unitTextField, c); JLabel variablesLabel = new JLabel(); variablesLabel.setName("variablesLabel"); variablesLabel.setText(PROPERTY_REPO.getValue(VARIABLES_KEY)); c = createDefaultGridBagConstraints(); c.fill = GridBagConstraints.NONE; c.weightx = 0; c.gridx = 0; c.gridy = 3; c.gridwidth = 1; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new java.awt.Insets(0, 10, 10, 10); container.add(variablesLabel, c); JPanel variablesPanel = buildVariablesPanel(); c = createDefaultGridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 0; c.gridx = 0; c.gridy = 4; c.gridwidth = GridBagConstraints.REMAINDER; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new java.awt.Insets(0, 10, 10, 10); c.weightx = 1; c.weighty = 1; container.add(variablesPanel, c); JLabel formulaLabel = new JLabel(); formulaLabel.setName("formulaLabel"); formulaLabel.setText(PROPERTY_REPO.getValue(FORMULA_KEY)); c = createDefaultGridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 0; c.gridx = 0; c.gridy = 5; c.gridwidth = GridBagConstraints.REMAINDER; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new java.awt.Insets(0, 10, 10, 10); container.add(formulaLabel, c); JScrollPane formulaScrollPane = new JScrollPane(formulaTextArea); c = createDefaultGridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; c.gridx = 0; c.gridy = 6; c.gridwidth = GridBagConstraints.REMAINDER; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new java.awt.Insets(0, 10, 10, 10); container.add(formulaScrollPane, c); JPanel footerPanel = buildFooterPanel(); c = createDefaultGridBagConstraints(); c.fill = GridBagConstraints.NONE; c.weightx = 0.5; c.weighty = 0; c.gridx = 0; c.gridy = 7; c.gridwidth = GridBagConstraints.REMAINDER; ; c.anchor = GridBagConstraints.LINE_END; c.insets = new java.awt.Insets(0, 0, 10, 5); container.add(footerPanel, c); // bind keystrokes InputMap inputMap = container.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke("ENTER"), "addChannel"); inputMap.put(KeyStroke.getKeyStroke("ESCAPE"), "cancel"); // initially disable buttons removeVariableButton.setEnabled(false); pack(); setLocationByPlatform(true); setVisible(true); }
From source file:org.rockyroadshub.planner.core.gui.calendar.FormPane.java
private void update0(JLabel limit, String format, DefaultStyledDocument doc) { limit.setText(String.format(format, doc.getLength())); }
From source file:org.springframework.richclient.core.LabelInfo.java
/** * Configures the given label with the parameters from this instance. * * @param label The label that is to be configured. * @throws IllegalArgumentException if {@code label} is null. *//*from w ww. j ava 2 s .c o m*/ public void configureLabel(JLabel label) { Assert.required(label, "label"); label.setText(this.text); label.setDisplayedMnemonic(getMnemonic()); if (getMnemonicIndex() >= -1) { label.setDisplayedMnemonicIndex(getMnemonicIndex()); } }
From source file:org.springframework.richclient.core.LabelInfo.java
/** * Configures the given label with the property values described by this instance and then sets * it as the label for the given component. * * @param label The label to be configured. * @param component The component that the label is 'for'. * * @throws IllegalArgumentException if either argument is null. * * @see JLabel#setLabelFor(java.awt.Component) */// ww w . j av a 2 s .c om public void configureLabelFor(JLabel label, JComponent component) { Assert.required(label, "label"); Assert.required(component, "component"); configureLabel(label); if (!(component instanceof JPanel)) { String labelText = label.getText(); if (!labelText.endsWith(":")) { if (logger.isDebugEnabled()) { logger.debug("Appending colon to text field label text '" + this.text + "'"); } label.setText(labelText + ":"); } } label.setLabelFor(component); }