List of usage examples for javax.swing JLabel setBounds
public void setBounds(int x, int y, int width, int height)
From source file:org.ow2.aspirerfid.demos.warehouse.management.UI.WarehouseManagement.java
/** * Initialize the contents of the frame//w w w.j a v a 2s.c o 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 ww . ja va 2 s . com */ 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.spoutcraft.launcher.skin.ModpackSelector.java
public ModpackSelector(LauncherFrame frame, AvailablePackList packList, UserModel userModel, MirrorStore mirrorStore) {/*from w ww. j a va2s . co m*/ this.frame = frame; this.mPackList = packList; this.mUserModel = userModel; this.mirrorStore = mirrorStore; this.mPackList.addPackListener(this); for (int i = 0; i < 7; i++) { PackButton button = new PackButton(); buttons.add(button); JLabel label = button.getJLabel(); JLabel icon = button.getDisconnectedIcon(); button.setActionCommand(PACK_SELECT_ACTION); button.addActionListener(this); if (i == 3) { button.setBounds(bigX, bigY, bigWidth, bigHeight); label.setBounds(bigX, bigY + bigHeight - 24, bigWidth, 24); icon.setBounds(bigX + bigWidth - 80, bigY, 80, 17); label.setFont(label.getFont().deriveFont(14F)); button.setIndex(0); } else if (i < 3) { int smallY = bigY - (spacing * 2) - ((smallHeight + spacing) * (i + 1)); button.setBounds(smallX, smallY, smallWidth, smallHeight); label.setBounds(smallX, smallY + smallHeight - 20, smallWidth, 20); icon.setBounds(smallX + smallWidth - 80, smallY, 80, 17); button.setIndex((i + 1) * -1); } else if (i > 3) { int smallY = bigY + bigHeight + ((smallHeight + spacing) * (i - 4)) + (spacing * 3); button.setBounds(smallX, smallY, smallWidth, smallHeight); label.setBounds(smallX, smallY + smallHeight - 20, smallWidth, 20); icon.setBounds(smallX + smallWidth - 80, smallY, 80, 17); button.setIndex(i - 3); } this.add(label); this.add(icon); this.add(button); } }
From source file:org.spoutcraft.launcher.technic.skin.ModpackSelector.java
public ModpackSelector(TechnicLoginFrame frame) { this.frame = frame; for (int i = 0; i < 7; i++) { PackButton button = new PackButton(); buttons.add(button);/*from w ww. j av a2 s .co m*/ JLabel label = button.getJLabel(); button.setActionCommand(PACK_SELECT_ACTION); button.addActionListener(this); if (i == 3) { button.setBounds(bigX, bigY, bigWidth, bigHeight); label.setBounds(bigX, bigY + bigHeight - 24, bigWidth, 24); label.setFont(label.getFont().deriveFont(14F)); button.setIndex(0); } else if (i < 3) { int smallY = bigY - (spacing * 2) - ((smallHeight + spacing) * (i + 1)); button.setBounds(smallX, smallY, smallWidth, smallHeight); label.setBounds(smallX, smallY + smallHeight - 20, smallWidth, 20); button.setIndex((i + 1) * -1); } else if (i > 3) { int smallY = bigY + bigHeight + ((smallHeight + spacing) * (i - 4)) + (spacing * 3); button.setBounds(smallX, smallY, smallWidth, smallHeight); label.setBounds(smallX, smallY + smallHeight - 20, smallWidth, 20); button.setIndex(i - 3); } this.add(button.getJLabel()); this.add(button); } }
From source file:org.zaproxy.zap.extension.cmss.CMSSFrame.java
/** Create the frame. */ public CMSSFrame() { setTitle("Fingerprinting tools"); setResizable(false);//from w ww . j a v a 2 s. c o m setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); setBounds(100, 100, 756, 372); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new BorderLayout(0, 0)); setContentPane(contentPane); JLayeredPane layeredPane = new JLayeredPane(); contentPane.add(layeredPane, BorderLayout.CENTER); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); tabbedPane.setBounds(0, 0, 725, 323); layeredPane.add(tabbedPane); JLayeredPane layeredPane_1 = new JLayeredPane(); tabbedPane.addTab("Fingerprint", null, layeredPane_1, null); JLabel label = new JLabel("App name:"); label.setBounds(35, 188, 76, 14); layeredPane_1.add(label); JLabel label_1 = new JLabel("Version:"); label_1.setBounds(35, 230, 76, 14); layeredPane_1.add(label_1); textField = new JTextField(); textField.setColumns(10); textField.setBounds(121, 188, 109, 29); layeredPane_1.add(textField); textField_1 = new JTextField(); textField_1.setColumns(10); textField_1.setBounds(121, 223, 109, 29); layeredPane_1.add(textField_1); JSeparator separator = new JSeparator(); separator.setBounds(35, 72, 665, 2); layeredPane_1.add(separator); JSeparator separator_1 = new JSeparator(); separator_1.setBounds(196, 11, 1, 201); layeredPane_1.add(separator_1); JSeparator separator_2 = new JSeparator(); separator_2.setOrientation(SwingConstants.VERTICAL); separator_2.setBounds(260, 81, 1, 201); layeredPane_1.add(separator_2); final JCheckBox chckbxGetVersion = new JCheckBox("Get version"); chckbxGetVersion.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (textField_1.isEnabled() && !chckbxGetVersion.isSelected()) textField_1.setEnabled(false); if (!textField_1.isEnabled() && chckbxGetVersion.isSelected()) textField_1.setEnabled(true); } }); chckbxGetVersion.setBounds(35, 81, 195, 23); layeredPane_1.add(chckbxGetVersion); final JCheckBox chckbxPassiveFingerprinting = new JCheckBox("Passive"); chckbxPassiveFingerprinting.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); chckbxPassiveFingerprinting.setBounds(35, 107, 195, 23); chckbxPassiveFingerprinting.setSelected(true); // layeredPane_1.add(chckbxPassiveFingerprinting); final JCheckBox chckbxAgressive = new JCheckBox("Agressive"); chckbxAgressive.setBounds(35, 133, 195, 23); layeredPane_1.add(chckbxAgressive); JLabel lblWhatToFingerprint = new JLabel("What to fingerprint ?"); lblWhatToFingerprint.setBounds(287, 81, 109, 14); layeredPane_1.add(lblWhatToFingerprint); JCheckBox chckbxCms = new JCheckBox("cms"); chckbxCms.setBounds(280, 102, 134, 23); layeredPane_1.add(chckbxCms); JCheckBox chckbxMessageboards = new JCheckBox("message-boards"); chckbxMessageboards.setBounds(280, 128, 134, 23); layeredPane_1.add(chckbxMessageboards); JCheckBox chckbxJavascriptframeworks = new JCheckBox("javascript-frameworks"); chckbxJavascriptframeworks.setBounds(281, 154, 133, 23); layeredPane_1.add(chckbxJavascriptframeworks); JCheckBox chckbxWebframeworks = new JCheckBox("web-frameworks"); chckbxWebframeworks.setBounds(281, 178, 133, 23); layeredPane_1.add(chckbxWebframeworks); JCheckBox chckbxWebservers = new JCheckBox("web-servers"); chckbxWebservers.setBounds(281, 204, 133, 23); layeredPane_1.add(chckbxWebservers); JSeparator separator_4 = new JSeparator(); separator_4.setOrientation(SwingConstants.VERTICAL); separator_4.setBounds(435, 81, 1, 201); layeredPane_1.add(separator_4); JCheckBox chckbxDatabases = new JCheckBox("databases"); chckbxDatabases.setBounds(281, 228, 133, 23); layeredPane_1.add(chckbxDatabases); JButton btnMore = new JButton("More"); btnMore.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { wtfpFrame = new WhatToFingerPrintFrame(); wtfpFrame.setLocationRelativeTo(null); wtfpFrame.setVisible(true); } }); btnMore.setBounds(291, 261, 123, 23); layeredPane_1.add(btnMore); JLabel lblFingerprintingTimeAnd = new JLabel("Fingerprinting time and occuracy settings:"); lblFingerprintingTimeAnd.setBounds(490, 81, 210, 14); layeredPane_1.add(lblFingerprintingTimeAnd); JButton btnFingerprint = new JButton("Fingerprint"); btnFingerprint.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (!chckbxPassiveFingerprinting.isSelected() && !chckbxAgressive.isSelected()) chckbxPassiveFingerprinting.setSelected(true); if (chckbxPassiveFingerprinting.isSelected() && !chckbxAgressive.isSelected()) POrAOption = 1; else if (!chckbxPassiveFingerprinting.isSelected() && chckbxAgressive.isSelected()) POrAOption = 2; else if (chckbxPassiveFingerprinting.isSelected() && chckbxAgressive.isSelected()) POrAOption = 3; try { targetUrl = new URL(txtHttp.getText()); } catch (MalformedURLException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } System.out.println("POrAOption : " + POrAOption); // we concatenate the two ArrayLists ArrayList<String> wtfpList = getWhatToFingerprint(); for (String wtfp : wtfpFrame.getWhatToFingerprint()) { wtfpList.add(wtfp); } // we call FastFingerprinter.filterResults on the global whatToFingerPrint // List fpThread = new FingerPrintingThread(targetUrl, wtfpList, POrAOption); fpThread.start(); while (fpThread.isAlive()) { // waiting; } ArrayList<String> resultList = fpThread.getFingerPrintingResult(); for (String app : resultList) { textField.setText(textField.getText() + app + " , "); } if (chckbxGetVersion.isSelected()) { System.out.println("wiw"); ArrayList<String> versions = new ArrayList<String>(); if (resultList.contains("wordpress")) { textField_1.setText(textField_1.getText() + "wordpress :"); for (String version : FastFingerprinter.WordpressFastFingerprint(targetUrl)) { textField_1.setText(textField_1.getText() + version + " ; "); } } if (resultList.contains("joomla")) { textField_1.setText(textField_1.getText() + "joomla :"); for (String version : FastFingerprinter.JoomlaFastFingerprint(targetUrl)) { textField_1.setText(textField_1.getText() + version + " ; "); } } // blindelephant for (String app : resultList) { System.out.println("---->" + app); try { versions = WebAppGuesser.fingerPrintFile(app); textField_1.setText(textField_1.getText() + app + " : "); for (String version : versions) { textField_1.setText(textField_1.getText() + version + " ; "); } } catch (NoSuchAlgorithmException | IOException | DecoderException e1) { e1.printStackTrace(); } } } } }); btnFingerprint.setBounds(35, 154, 195, 23); layeredPane_1.add(btnFingerprint); JButton btnDetailedView = new JButton("Detailed view "); btnDetailedView.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); btnDetailedView.setBounds(35, 259, 195, 23); layeredPane_1.add(btnDetailedView); this.checkBoxesList.add(chckbxCms); this.checkBoxesList.add(chckbxJavascriptframeworks); this.checkBoxesList.add(chckbxWebframeworks); this.checkBoxesList.add(chckbxWebservers); this.checkBoxesList.add(chckbxDatabases); this.checkBoxesList.add(chckbxMessageboards); txtHttp = new JTextField(); txtHttp.setText("http://"); txtHttp.setBounds(128, 22, 568, 29); layeredPane_1.add(txtHttp); txtHttp.setColumns(10); JLabel lblTarget = new JLabel("Target : "); lblTarget.setBounds(51, 29, 46, 14); layeredPane_1.add(lblTarget); JLayeredPane layeredPane_2 = new JLayeredPane(); tabbedPane.addTab("Details", null, layeredPane_2, null); JTabbedPane tabbedPane_1 = new JTabbedPane(JTabbedPane.TOP); tabbedPane_1.setBounds(0, 0, 720, 223); layeredPane_2.add(tabbedPane_1); JLayeredPane layeredPane_4 = new JLayeredPane(); tabbedPane_1.addTab("Detailed result", null, layeredPane_4, null); JLayeredPane layeredPane_3 = new JLayeredPane(); tabbedPane_1.addTab("Passive fingerprint", null, layeredPane_3, null); JTabbedPane tabbedPane_2 = new JTabbedPane(JTabbedPane.TOP); tabbedPane_1.addTab("Agressive fingerprint", null, tabbedPane_2, null); }
From source file:projectresurrection.Music.java
public void subMenu(int menu) { JPanel panel = (JPanel) ((JViewport) ((JScrollPane) pnlSub.getComponent(3)).getComponent(0)) .getComponent(0);// w w w.j a v a 2s . com JLabel header = (JLabel) pnlSub.getComponent(1); JLabel label; panel.removeAll(); int y = 10; switch (menu) { case 0: header.setText("Artists"); panel.setPreferredSize(new Dimension(349, (55 + (artists.size() * 35)))); label = new JLabel("All"); label.setOpaque(true); label.setBackground(new Color(245, 245, 245)); label.setFont(new Font("Tahoma", Font.PLAIN, 20)); label.setBounds(10, y, 339, 35); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { subMenu(ALBUMS); panel.revalidate(); panel.repaint(); } }); panel.add(label); y += 35; List artistList = new ArrayList(artists.keySet()); Collections.sort(artistList); for (int i = 0; i < artistList.size(); i++) { String artist = artistList.get(i).toString(); label = new JLabel(artist); label.setOpaque(true); if (i % 2 == 1) { label.setBackground(new Color(245, 245, 245)); } label.setFont(new Font("Tahoma", Font.PLAIN, 20)); label.setBounds(10, y, 339, 35); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { subMenu(ARTISTS, artist); panel.revalidate(); panel.repaint(); } }); panel.add(label); y += 35; } break; case 1: header.setText("Albums"); panel.setPreferredSize(new Dimension(349, (55 + (albums.size() * 35)))); label = new JLabel("All"); label.setOpaque(true); label.setBackground(new Color(245, 245, 245)); label.setFont(new Font("Tahoma", Font.PLAIN, 20)); label.setBounds(10, y, 339, 35); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { subMenu(SONGS); panel.revalidate(); panel.repaint(); } }); panel.add(label); y += 35; List albumList = new ArrayList(albums.keySet()); Collections.sort(albumList); for (int i = 0; i < albumList.size(); i++) { String album = albumList.get(i).toString(); label = new JLabel(album); label.setOpaque(true); if (i % 2 == 1) { label.setBackground(new Color(245, 245, 245)); } label.setFont(new Font("Tahoma", Font.PLAIN, 20)); label.setBounds(10, y, 339, 35); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { subMenu(ALBUMS, album); panel.revalidate(); panel.repaint(); } }); panel.add(label); y += 35; } break; case 2: header.setText("Songs"); panel.setPreferredSize(new Dimension(349, (20 + (songs.size() * 35)))); List songList = new ArrayList(songs.keySet()); Collections.sort(songList); List fileList = new ArrayList(); for (int i = 0; i < songList.size(); i++) { fileList.add(((List) songs.get(songList.get(i))).get(0)); } for (int i = 0; i < songList.size(); i++) { int num = i; String song = songList.get(i).toString(); label = new JLabel(song); label.setOpaque(true); if (i % 2 == 0) { label.setBackground(new Color(245, 245, 245)); } label.setFont(new Font("Tahoma", Font.PLAIN, 20)); label.setBounds(10, y, 339, 35); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { player.setPlaylist(fileList, num); pnlSub.setVisible(false); pnlPlayer.setVisible(true); try { Thread.sleep(200); } catch (Exception e) { } if (player.isPlaying() == false) { player.toggle(); } } }); panel.add(label); y += 35; } break; } pnlMenu.setVisible(false); pnlSub.setVisible(true); }
From source file:projectresurrection.Music.java
public void subMenu(int type, String menu) { JPanel panel = (JPanel) ((JViewport) ((JScrollPane) pnlSub.getComponent(3)).getComponent(0)) .getComponent(0);//from w w w . j a v a 2 s . c o m JLabel header = (JLabel) pnlSub.getComponent(1); JLabel label; header.setText(menu); panel.removeAll(); int y = 10; switch (type) { case 0: List albumList = new ArrayList(((Map) artists.get(menu)).keySet()); Collections.sort(albumList); panel.setPreferredSize(new Dimension(349, (55 + (albumList.size() * 35)))); label = new JLabel("All"); label.setOpaque(true); label.setBackground(new Color(245, 245, 245)); label.setFont(new Font("Tahoma", Font.PLAIN, 20)); label.setBounds(10, y, 339, 35); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { subMenuAll(ARTISTS, menu); panel.revalidate(); panel.repaint(); } }); panel.add(label); y += 35; for (int i = 0; i < albumList.size(); i++) { String album = albumList.get(i).toString(); label = new JLabel(album); label.setOpaque(true); if (i % 2 == 1) { label.setBackground(new Color(245, 245, 245)); } label.setFont(new Font("Tahoma", Font.PLAIN, 20)); label.setBounds(10, y, 339, 35); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { subMenu(ALBUMS, album); panel.revalidate(); panel.repaint(); } }); panel.add(label); y += 35; } break; case 1: List songList = new ArrayList(); List albumSongs = new ArrayList(((Map) albums.get(menu)).keySet()); Collections.sort(albumSongs); Map tracks = new HashMap(); for (int i = 0; i < albumSongs.size(); i++) { String track = ((List) songs.get(albumSongs.get(i))).get(1).toString(); if (tracks.containsKey(track)) { track = track + "(1)"; int j = 2; while (tracks.containsKey(track)) { track = track + "(" + j + ")"; } } tracks.put(track, albumSongs.get(i)); } List nums = new ArrayList(tracks.keySet()); Collections.sort(nums); List hasTrack = new ArrayList(); List noTrack = new ArrayList(); for (int i = 0; i < nums.size(); i++) { if (nums.get(i).equals("-1")) { noTrack.add(tracks.get(nums.get(i))); } else { hasTrack.add(tracks.get(nums.get(i))); } } Collections.sort(noTrack); for (int i = 0; i < hasTrack.size(); i++) { songList.add(hasTrack.get(i)); } for (int i = 0; i < noTrack.size(); i++) { songList.add(noTrack.get(i)); } panel.setPreferredSize(new Dimension(349, (20 + (albumSongs.size() * 35)))); List fileList = new ArrayList(); for (int i = 0; i < songList.size(); i++) { fileList.add(((List) songs.get(songList.get(i))).get(0)); } for (int i = 0; i < songList.size(); i++) { int num = i; String song = songList.get(i).toString(); label = new JLabel(song); label.setOpaque(true); if (i % 2 == 0) { label.setBackground(new Color(245, 245, 245)); } label.setFont(new Font("Tahoma", Font.PLAIN, 20)); label.setBounds(10, y, 339, 35); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { player.setPlaylist(fileList, num); pnlSub.setVisible(false); pnlPlayer.setVisible(true); try { Thread.sleep(200); } catch (Exception e) { } if (player.isPlaying() == false) { player.toggle(); } } }); panel.add(label); y += 35; } break; } panel.revalidate(); panel.repaint(); }
From source file:projectresurrection.Music.java
public void subMenuAll(int type, String menu) { JPanel panel = (JPanel) ((JViewport) ((JScrollPane) pnlSub.getComponent(3)).getComponent(0)) .getComponent(0);/* ww w . j a v a2 s . c o m*/ JLabel header = (JLabel) pnlSub.getComponent(1); header.setText(menu + " - All"); panel.removeAll(); int y = 10; switch (type) { case 0: List songList = new ArrayList(); List albumList = new ArrayList(((Map) artists.get(menu)).keySet()); Collections.sort(albumList); for (int i = 0; i < albumList.size(); i++) { List albumSongs = new ArrayList(((Map) albums.get(albumList.get(i))).keySet()); Map tracks = new HashMap(); for (int j = 0; j < albumSongs.size(); j++) { String track = ((List) songs.get(albumSongs.get(j))).get(1).toString(); tracks.put(track, albumSongs.get(j)); } List nums = new ArrayList(tracks.keySet()); Collections.sort(nums); List hasTrack = new ArrayList(); List noTrack = new ArrayList(); for (int j = 0; j < nums.size(); j++) { if (nums.get(j).equals("-1")) { noTrack.add(tracks.get(nums.get(j))); } else { hasTrack.add(tracks.get(nums.get(j))); } } for (int j = 0; j < hasTrack.size(); j++) { songList.add(hasTrack.get(j)); } for (int j = 0; j < noTrack.size(); j++) { songList.add(noTrack.get(j)); } } panel.setPreferredSize(new Dimension(349, (20 + (songList.size() * 35)))); List fileList = new ArrayList(); for (int i = 0; i < songList.size(); i++) { fileList.add(((List) songs.get(songList.get(i))).get(0)); } for (int i = 0; i < songList.size(); i++) { int num = i; String song = songList.get(i).toString(); JLabel label = new JLabel(song); label.setOpaque(true); if (i % 2 == 0) { label.setBackground(new Color(245, 245, 245)); } label.setFont(new Font("Tahoma", Font.PLAIN, 20)); label.setBounds(10, y, 339, 35); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { player.setPlaylist(fileList, num); pnlSub.setVisible(false); pnlPlayer.setVisible(true); try { Thread.sleep(200); } catch (Exception e) { } if (player.isPlaying() == false) { player.toggle(); } } }); panel.add(label); y += 35; } break; } panel.revalidate(); panel.repaint(); }
From source file:uk.ac.ucl.chime.wrappers.RMTreeConstructor.java
private void addLabel(String lblContent) { JLabel lblClusterName = new JLabel(lblContent); _panelToFill.add(lblClusterName);/* www .j a va2s .c o m*/ lblClusterName.setBounds(_lastX, _lastY, 250, _defaultHeight); _lastY += _defaultHeight + _verticalGap; _panelToFill.revalidate(); }
From source file:updater.UpdaterGUI.java
@SuppressWarnings("resource") public UpdaterGUI() { try {/*from w w w .java2 s . c o m*/ URL url1 = new URL( "https://raw.githubusercontent.com/kvsjxd/Droid-PC-Suite/master/.release-version.txt"); ReadableByteChannel obj1 = Channels.newChannel(url1.openStream()); FileOutputStream outputstream1 = new FileOutputStream(".release-version.txt"); outputstream1.getChannel().transferFrom(obj1, 0, Long.MAX_VALUE); URL url2 = new URL( "https://raw.githubusercontent.com/kvsjxd/Droid-PC-Suite/master/.release-changelog.txt"); ReadableByteChannel obj2 = Channels.newChannel(url2.openStream()); FileOutputStream outputstream2 = new FileOutputStream(".release-changelog.txt"); outputstream2.getChannel().transferFrom(obj2, 0, Long.MAX_VALUE); FileReader file = new FileReader(".release-version.txt"); BufferedReader reader = new BufferedReader(file); String DownloadedString = reader.readLine(); File file2 = new File(".release-version.txt"); if (file2.exists() && !file2.isDirectory()) { file2.delete(); } AvailableUpdate = Double.parseDouble(DownloadedString); InputStreamReader reader2 = new InputStreamReader( getClass().getResourceAsStream("/others/app-version.txt")); String tmp = IOUtils.toString(reader2); ApplicationVersion = Double.parseDouble(tmp); } catch (Exception e) { e.printStackTrace(); } setIconImage(Toolkit.getDefaultToolkit().getImage(UpdaterGUI.class.getResource("/graphics/Icon.png"))); setResizable(false); setType(Type.UTILITY); setTitle("Updater"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 430, 415); contentPane = new JPanel(); contentPane.setBackground(Color.WHITE); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel lblApplicationVersion = new JLabel("App Version: v" + ApplicationVersion); lblApplicationVersion.setBounds(12, 12, 222, 15); contentPane.add(lblApplicationVersion); JLabel lblUpdateVersion = new JLabel("Update Version: v" + AvailableUpdate); lblUpdateVersion.setBounds(12, 30, 222, 15); contentPane.add(lblUpdateVersion); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(0, 51, 422, 281); contentPane.add(scrollPane); JTextArea UpdateChangelogViewer = new JTextArea(); scrollPane.setViewportView(UpdateChangelogViewer); JButton btnDownload = new JButton("Download"); btnDownload.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { JFrame parentFrame = new JFrame(); JFileChooser fileChooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter("Zip Files", "zip"); fileChooser.setFileFilter(filter); fileChooser.setDialogTitle("Save as"); int userSelection = fileChooser.showSaveDialog(parentFrame); if (userSelection == JFileChooser.APPROVE_OPTION) { File fileToSave = fileChooser.getSelectedFile(); try { URL url = new URL("https://github.com/kvsjxd/Droid-PC-Suite/releases/download/" + AvailableUpdate + "/DPCS.v" + AvailableUpdate + ".Stable.zip"); ReadableByteChannel obj = Channels.newChannel(url.openStream()); FileOutputStream outputstream = new FileOutputStream(fileToSave.getAbsolutePath() + ".zip"); outputstream.getChannel().transferFrom(obj, 0, Long.MAX_VALUE); JOptionPane.showMessageDialog(null, "Download complete!\nPlease delete this version and extract the downloaded zip\nwhich is saved at " + fileToSave.getAbsolutePath() + ".zip"); } catch (Exception e) { e.printStackTrace(); } } } }); btnDownload.setBounds(140, 344, 117, 25); contentPane.add(btnDownload); try { FileReader reader3 = new FileReader(new File(".release-changelog.txt")); UpdateChangelogViewer.read(reader3, ""); File file3 = new File(".release-changelog.txt"); if (file3.exists() && !file3.isDirectory()) { file3.delete(); } } catch (Exception e) { e.printStackTrace(); } }