List of usage examples for javax.swing SwingConstants TRAILING
int TRAILING
To view the source code for javax.swing SwingConstants TRAILING.
Click Source Link
From source file:Main.java
public static int asHAlign(String val) { if (val.equals("leading")) return SwingConstants.LEADING; else if (val.equals("trailing")) return SwingConstants.TRAILING; else if (val.equals("left")) return SwingConstants.LEFT; else if (val.equals("right")) return SwingConstants.RIGHT; else if (val.equals("center")) return SwingConstants.CENTER; assert false; return -1;/*from w ww .j a va2 s .com*/ }
From source file:Main.java
public static Window showBelow(Component parent, Window window, int horizontalAlignment) { final int DISTANCE = 2; if (null == parent) throw new IllegalArgumentException("parent null"); if (null == window) throw new IllegalArgumentException("parent null"); if (!((SwingConstants.LEADING == horizontalAlignment) || (SwingConstants.TRAILING == horizontalAlignment) || (SwingConstants.CENTER == horizontalAlignment) || (SwingConstants.SOUTH == horizontalAlignment))) { throw new IllegalArgumentException("Illegal horizontal alignment " + horizontalAlignment + " should be either SwingConstants.LEADING or " + "SwingConstants.TRAILING or SwingConstants.CENTER"); }/*from w ww.j ava 2 s . c om*/ window.pack(); Dimension windowSize = window.getPreferredSize(); Dimension parentSize = parent.getSize(); Point loc = parent.getLocationOnScreen(); int newX; if ((SwingConstants.CENTER == horizontalAlignment) || (SwingConstants.SOUTH == horizontalAlignment)) { newX = (parentSize.width - windowSize.width) / 2 + loc.x; } else if (SwingConstants.TRAILING == horizontalAlignment) { newX = loc.x + parentSize.width - windowSize.width; } else { newX = loc.x; } window.setLocation(newX, (loc.y + parentSize.height + DISTANCE)); window.setVisible(true); return window; }
From source file:bazaar4idea.ui.BzrCurrentBranchStatus.java
public BzrCurrentBranchStatus() { super(BAZAAR_ICON, SwingConstants.TRAILING); setVisible(false); }
From source file:PaintUtils.java
/** * Returns the bounds that the text of a label will be drawn into. * Takes into account the current font metrics. *//*from ww w. j a v a2s . com*/ public static Rectangle getTextBounds(Graphics g, JLabel label) { FontMetrics fm = g.getFontMetrics(); Rectangle2D r2d = fm.getStringBounds(label.getText(), g); Rectangle rect = r2d.getBounds(); int xOffset = 0; switch (label.getHorizontalAlignment()) { case SwingConstants.RIGHT: case SwingConstants.TRAILING: xOffset = label.getBounds().width - rect.width; break; case SwingConstants.CENTER: xOffset = (label.getBounds().width - rect.width) / 2; break; default: case SwingConstants.LEFT: case SwingConstants.LEADING: xOffset = 0; break; } int yOffset = 0; switch (label.getVerticalAlignment()) { case SwingConstants.TOP: yOffset = 0; break; case SwingConstants.CENTER: yOffset = (label.getBounds().height - rect.height) / 2; break; case SwingConstants.BOTTOM: yOffset = label.getBounds().height - rect.height; break; } return new Rectangle(xOffset, yOffset, rect.width, rect.height); }
From source file:components.TableFilterDemo.java
public TableFilterDemo() { super();//from w w w. ja v a 2 s. com setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); //Create a table with a sorter. MyTableModel model = new MyTableModel(); sorter = new TableRowSorter<MyTableModel>(model); table = new JTable(model); table.setRowSorter(sorter); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); table.setFillsViewportHeight(true); //For the purposes of this example, better to have a single //selection. table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); //When selection changes, provide user with row numbers for //both view and model. table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent event) { int viewRow = table.getSelectedRow(); if (viewRow < 0) { //Selection got filtered away. statusText.setText(""); } else { int modelRow = table.convertRowIndexToModel(viewRow); statusText.setText(String.format("Selected Row in view: %d. " + "Selected Row in model: %d.", viewRow, modelRow)); } } }); //Create the scroll pane and add the table to it. JScrollPane scrollPane = new JScrollPane(table); //Add the scroll pane to this panel. add(scrollPane); //Create a separate form for filterText and statusText JPanel form = new JPanel(new SpringLayout()); JLabel l1 = new JLabel("Filter Text:", SwingConstants.TRAILING); form.add(l1); filterText = new JTextField(); //Whenever filterText changes, invoke newFilter. filterText.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { newFilter(); } public void insertUpdate(DocumentEvent e) { newFilter(); } public void removeUpdate(DocumentEvent e) { newFilter(); } }); l1.setLabelFor(filterText); form.add(filterText); JLabel l2 = new JLabel("Status:", SwingConstants.TRAILING); form.add(l2); statusText = new JTextField(); l2.setLabelFor(statusText); form.add(statusText); SpringUtilities.makeCompactGrid(form, 2, 2, 6, 6, 6, 6); add(form); }
From source file:PostTest.java
public PostTestFrame() { setTitle("PostTest"); northPanel = new JPanel(); add(northPanel, BorderLayout.NORTH); northPanel.setLayout(new GridLayout(0, 2)); northPanel.add(new JLabel("Host: ", SwingConstants.TRAILING)); final JTextField hostField = new JTextField(); northPanel.add(hostField);//w w w.ja va 2 s . co m northPanel.add(new JLabel("Action: ", SwingConstants.TRAILING)); final JTextField actionField = new JTextField(); northPanel.add(actionField); for (int i = 1; i <= 8; i++) northPanel.add(new JTextField()); final JTextArea result = new JTextArea(20, 40); add(new JScrollPane(result)); JPanel southPanel = new JPanel(); add(southPanel, BorderLayout.SOUTH); JButton addButton = new JButton("More"); southPanel.add(addButton); addButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { northPanel.add(new JTextField()); northPanel.add(new JTextField()); pack(); } }); JButton getButton = new JButton("Get"); southPanel.add(getButton); getButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { result.setText(""); final Map<String, String> post = new HashMap<String, String>(); for (int i = 4; i < northPanel.getComponentCount(); i += 2) { String name = ((JTextField) northPanel.getComponent(i)).getText(); if (name.length() > 0) { String value = ((JTextField) northPanel.getComponent(i + 1)).getText(); post.put(name, value); } } new SwingWorker<Void, Void>() { protected Void doInBackground() throws Exception { try { String urlString = hostField.getText() + "/" + actionField.getText(); result.setText(doPost(urlString, post)); } catch (IOException e) { result.setText("" + e); } return null; } }.execute(); } }); pack(); }
From source file:TableFilterDemo.java
public TableFilterDemo() { super();//from w ww . j a v a 2s .co m setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); // Create a table with a sorter. MyTableModel model = new MyTableModel(); sorter = new TableRowSorter<MyTableModel>(model); table = new JTable(model); table.setRowSorter(sorter); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); table.setFillsViewportHeight(true); // For the purposes of this example, better to have a single // selection. table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); // When selection changes, provide user with row numbers for // both view and model. table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent event) { int viewRow = table.getSelectedRow(); if (viewRow < 0) { // Selection got filtered away. statusText.setText(""); } else { int modelRow = table.convertRowIndexToModel(viewRow); statusText.setText(String.format("Selected Row in view: %d. " + "Selected Row in model: %d.", viewRow, modelRow)); } } }); // Create the scroll pane and add the table to it. JScrollPane scrollPane = new JScrollPane(table); // Add the scroll pane to this panel. add(scrollPane); // Create a separate form for filterText and statusText JPanel form = new JPanel(new SpringLayout()); JLabel l1 = new JLabel("Filter Text:", SwingConstants.TRAILING); form.add(l1); filterText = new JTextField(); // Whenever filterText changes, invoke newFilter. filterText.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { newFilter(); } public void insertUpdate(DocumentEvent e) { newFilter(); } public void removeUpdate(DocumentEvent e) { newFilter(); } }); l1.setLabelFor(filterText); form.add(filterText); JLabel l2 = new JLabel("Status:", SwingConstants.TRAILING); form.add(l2); statusText = new JTextField(); l2.setLabelFor(statusText); form.add(statusText); SpringUtilities.makeCompactGrid(form, 2, 2, 6, 6, 6, 6); add(form); }
From source file:edu.harvard.mcz.imagecapture.BulkMediaFrame.java
private void init() { thisFrame = this; setTitle("BulkMedia Preparation"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 902, 174);/*from w w w .j a v a2 s . com*/ JMenuBar menuBar = new JMenuBar(); setJMenuBar(menuBar); JMenu mnFile = new JMenu("File"); mnFile.setMnemonic(KeyEvent.VK_F); menuBar.add(mnFile); JMenuItem mntmPrepareDirectory = new JMenuItem("Prepare Directory"); mntmPrepareDirectory.setMnemonic(KeyEvent.VK_D); mntmPrepareDirectory.addActionListener(new PrepareDirectoryAction()); mnFile.add(mntmPrepareDirectory); JMenuItem mntmNewMenuItem = new JMenuItem("Exit"); mntmNewMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { done(); } }); JMenuItem mntmNewMenuItem_1 = new JMenuItem("Edit Properties"); mntmNewMenuItem_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PropertiesEditor p = new PropertiesEditor(); p.pack(); p.setVisible(true); } }); mnFile.add(mntmNewMenuItem_1); mntmNewMenuItem.setMnemonic(KeyEvent.VK_X); mntmNewMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK)); mnFile.add(mntmNewMenuItem); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(new BorderLayout(0, 0)); JPanel panel = new JPanel(); contentPane.add(panel, BorderLayout.CENTER); panel.setLayout(new GridLayout(3, 2, 0, 0)); JLabel lblBaseUri = new JLabel("Base URI (first part of path to images on the web)"); lblBaseUri.setHorizontalAlignment(SwingConstants.TRAILING); panel.add(lblBaseUri, "2, 2"); textField = new JTextField(); textField.setEditable(false); textField.setText(Singleton.getSingletonInstance().getProperties().getProperties() .getProperty(ImageCaptureProperties.KEY_IMAGEBASEURI)); panel.add(textField); textField.setColumns(10); JLabel lblNewLabel = new JLabel("Local Path To Base (local mount path that maps to base URI)"); lblNewLabel.setHorizontalAlignment(SwingConstants.TRAILING); panel.add(lblNewLabel); textField_1 = new JTextField(); textField_1.setEditable(false); textField_1.setText(Singleton.getSingletonInstance().getProperties().getProperties() .getProperty(ImageCaptureProperties.KEY_IMAGEBASE)); panel.add(textField_1); textField_1.setColumns(10); JLabel lblBeforeExitingWait = new JLabel( "Before exiting wait for both the Done and Thumbnails Built messages."); panel.add(lblBeforeExitingWait); JLabel lblThumbnailGenerationIs = new JLabel("Thumbnail generation is not reported on the progress bar."); panel.add(lblThumbnailGenerationIs); progressBar = new JProgressBar(); progressBar.setStringPainted(false); contentPane.add(progressBar, BorderLayout.NORTH); JPanel panel_1 = new JPanel(); contentPane.add(panel_1, BorderLayout.SOUTH); JButton btnPrepareDirectory = new JButton("Run"); btnPrepareDirectory.setToolTipText("Select a directory and prepare a bulk media file for images therein."); panel_1.add(btnPrepareDirectory); btnPrepareDirectory.addActionListener(new PrepareDirectoryAction()); btnPrepareDirectory.setPreferredSize(new Dimension(80, 25)); JButton btnExit = new JButton("Exit"); btnExit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { done(); } }); panel_1.add(btnExit); }
From source file:com.floreantpos.ui.model.PizzaItemForm.java
private void initComponents() { setLayout(new BorderLayout()); JLabel lblButtonColor = new JLabel(Messages.getString("MenuItemForm.19")); //$NON-NLS-1$ tabbedPane = new javax.swing.JTabbedPane(); JPanel tabGeneral = new javax.swing.JPanel(); JLabel lblName = new JLabel(); lblName.setHorizontalAlignment(SwingConstants.TRAILING); tfName = new com.floreantpos.swing.FixedLengthTextField(20); tfDescription = new JTextArea(new FixedLengthDocument(120)); JLabel lTax = new javax.swing.JLabel(); lTax.setHorizontalAlignment(SwingConstants.TRAILING); cbTax = new javax.swing.JComboBox(); JButton btnNewTax = new javax.swing.JButton(); JPanel tabShift = new javax.swing.JPanel(); JPanel tabPrice = new javax.swing.JPanel(); JPanel tabButtonStyle = new javax.swing.JPanel(); JButton btnDeleteShift = new javax.swing.JButton(); JButton btnAddShift = new javax.swing.JButton(); JButton btnNewPrice = new javax.swing.JButton(); JButton btnUpdatePrice = new javax.swing.JButton(); JButton btnDeletePrice = new javax.swing.JButton(); JButton btnDeleteAll = new javax.swing.JButton(); JButton btnDefaultValue = new javax.swing.JButton(); JButton btnAutoGenerate = new javax.swing.JButton(); JScrollPane jScrollPane2 = new javax.swing.JScrollPane(); JScrollPane priceTabScrollPane = new javax.swing.JScrollPane(); shiftTable = new JTable(); priceTable = new JTable(); priceTable.setRowHeight(PosUIManager.getSize(priceTable.getRowHeight())); priceTable.setCellSelectionEnabled(true); priceTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); priceTable.setSurrendersFocusOnKeystroke(true); cbPrinterGroup = new JComboBox<PrinterGroup>(new DefaultComboBoxModel<PrinterGroup>( PrinterGroupDAO.getInstance().findAll().toArray(new PrinterGroup[0]))); cbPrinterGroup.setPreferredSize(new Dimension(226, 0)); tfDefaultSellPortion = new IntegerTextField(10); tfTranslatedName = new FixedLengthTextField(20); tfTranslatedName.setLength(120);/* w w w . j a v a 2s . co m*/ lblKitchenPrinter = new JLabel(Messages.getString("MenuItemForm.27")); //$NON-NLS-1$ lblName.setText(Messages.getString("LABEL_NAME")); //$NON-NLS-1$ tfName.setLength(120); JLabel lblTranslatedName = new JLabel(Messages.getString("MenuItemForm.lblTranslatedName.text")); //$NON-NLS-1$ tfSortOrder = new IntegerTextField(20); tfSortOrder.setText(""); //$NON-NLS-1$ cbTax.setPreferredSize(new Dimension(198, 0)); btnButtonColor = new JButton(); //$NON-NLS-1$ btnButtonColor.setPreferredSize(new Dimension(228, 40)); JLabel lblTextColor = new JLabel(Messages.getString("MenuItemForm.lblTextColor.text")); //$NON-NLS-1$ btnTextColor = new JButton(Messages.getString("MenuItemForm.SAMPLE_TEXT")); //$NON-NLS-1$ cbShowTextWithImage = new JCheckBox(Messages.getString("MenuItemForm.40")); //$NON-NLS-1$ cbShowTextWithImage.setActionCommand(Messages.getString("MenuItemForm.41")); //$NON-NLS-1$ lTax.setText(Messages.getString("LABEL_TAX")); //$NON-NLS-1$ btnNewTax.setText("..."); lTax.setText(Messages.getString("LABEL_TAX")); //$NON-NLS-1$ btnNewTax.setText("..."); //$NON-NLS-1$ btnNewTax.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNewTaxdoCreateNewTax(evt); } }); tabbedPane.addTab(com.floreantpos.POSConstants.GENERAL, tabGeneral); tabbedPane.setPreferredSize(new Dimension(750, 470)); tabbedPane.addTab(com.floreantpos.POSConstants.MODIFIER_GROUPS, getModifierGroupTab()); btnAddShift.addActionListener(this); btnDeleteShift.addActionListener(this); tabGeneral.setLayout(new MigLayout("insets 20", "[][]20px[][]", "[][][][][][][][][][][][][]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ tabGeneral.add(lblName, "cell 0 1 ,right"); //$NON-NLS-1$ tabGeneral.add(tfName, "cell 1 1,grow"); //$NON-NLS-1$ tabGeneral.add(lblTranslatedName, "cell 0 2,right"); //$NON-NLS-1$ tabGeneral.add(tfTranslatedName, "cell 1 2,grow"); JLabel lgroup = new javax.swing.JLabel(); lgroup.setHorizontalAlignment(SwingConstants.TRAILING); lgroup.setText(Messages.getString("LABEL_GROUP")); //$NON-NLS-1$ tabGeneral.add(lgroup, "cell 0 3,alignx right"); //$NON-NLS-1$ JLabel lblBarcode = new JLabel(Messages.getString("MenuItemForm.lblBarcode.text")); //$NON-NLS-1$ tabGeneral.add(lblBarcode, "cell 0 4,alignx right"); //$NON-NLS-1$ tfBarcode = new FixedLengthTextField(20); tabGeneral.add(tfBarcode, "cell 1 4,grow"); //$NON-NLS-1$ JLabel lblStockCount = new JLabel(Messages.getString("MenuItemForm.17")); //$NON-NLS-1$ tabGeneral.add(lblStockCount, "cell 0 5,alignx right"); //$NON-NLS-1$ tfStockCount = new DoubleTextField(1); tabGeneral.add(tfStockCount, "cell 1 5,grow"); //$NON-NLS-1$ chkVisible = new javax.swing.JCheckBox(); tabGeneral.add(new JLabel("Default sell portion (%)"), "cell 0 6"); tabGeneral.add(tfDefaultSellPortion, "cell 1 6,grow"); chkVisible.setText(com.floreantpos.POSConstants.VISIBLE); chkVisible.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); chkVisible.setMargin(new java.awt.Insets(0, 0, 0, 0)); tabGeneral.add(chkVisible, "cell 1 7"); tabGeneral.add(lblKitchenPrinter, "cell 2 1,right"); //$NON-NLS-1$ tabGeneral.add(cbPrinterGroup, "cell 3 1,grow"); //$NON-NLS-1$ tabGeneral.add(lTax, "cell 2 2,right"); //$NON-NLS-1$ tabGeneral.add(cbTax, "cell 3 2"); //$NON-NLS-1$ tabGeneral.add(btnNewTax, "cell 3 2,grow"); //$NON-NLS-1$ cbGroup = new javax.swing.JComboBox(); cbGroup.setPreferredSize(new Dimension(198, 0)); tabGeneral.add(cbGroup, "flowx,cell 1 3"); //$NON-NLS-1$ JButton btnNewGroup = new javax.swing.JButton(); btnNewGroup.setText("..."); //$NON-NLS-1$ btnNewGroup.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { doCreateNewGroup(evt); } }); tabGeneral.add(btnNewGroup, "cell 1 3"); //$NON-NLS-1$ tabGeneral.add(new JLabel(Messages.getString("MenuItemForm.25")), "cell 2 3,right"); //$NON-NLS-1$ //$NON-NLS-2$ orderList = new CheckBoxList(); List<OrderType> orderTypes = Application.getInstance().getOrderTypes(); orderList.setModel(orderTypes); JScrollPane orderCheckBoxList = new JScrollPane(orderList); orderCheckBoxList.setPreferredSize(new Dimension(228, 100)); tabGeneral.add(orderCheckBoxList, "cell 3 3 3 3"); //$NON-NLS-1$ cbDisableStockCount = new JCheckBox(Messages.getString("MenuItemForm.18")); //$NON-NLS-1$ tabGeneral.add(cbDisableStockCount, "cell 1 8"); //$NON-NLS-1$ tabGeneral.add(new JLabel(Messages.getString("MenuItemForm.29")), "cell 2 6,alignx right"); //$NON-NLS-1$ //$NON-NLS-2$ JScrollPane scrlDescription = new JScrollPane(tfDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrlDescription.setPreferredSize(new Dimension(228, 70)); tfDescription.setLineWrap(true); tabGeneral.add(scrlDescription, "cell 3 6 3 3"); //$NON-NLS-1$ add(tabbedPane); //TODO: addRecepieExtension(); btnDeleteShift.setText(com.floreantpos.POSConstants.DELETE_SHIFT); btnAddShift.setText(com.floreantpos.POSConstants.ADD_SHIFT); shiftTable .setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ jScrollPane2.setViewportView(shiftTable); org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(tabShift); tabShift.setLayout(jPanel3Layout); jPanel3Layout .setHorizontalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup().addContainerGap(76, Short.MAX_VALUE) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 670, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel3Layout.createSequentialGroup().add(btnAddShift).add(5, 5, 5) .add(btnDeleteShift))) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup() .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 345, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(btnAddShift).add(btnDeleteShift)) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); tabbedPane.addTab(com.floreantpos.POSConstants.SHIFTS, tabShift); btnNewPrice.setText(Messages.getString("MenuItemForm.9")); //$NON-NLS-1$ btnNewPrice.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { addNewPrice(); } }); btnUpdatePrice.setText(Messages.getString("MenuItemForm.13")); //$NON-NLS-1$ btnUpdatePrice.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { updatePrice(); } }); btnDeletePrice.setText(Messages.getString("MenuItemForm.14")); //$NON-NLS-1$ btnDeletePrice.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { deletePrice(); } }); btnAutoGenerate.setText("Auto Generate"); //$NON-NLS-1$ btnAutoGenerate.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { autoGeneratePizzaItemSizeAndPrice(); } }); btnDeleteAll.setText(Messages.getString("MenuItemForm.15")); //$NON-NLS-1$ btnDeleteAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { deleteAll(); } }); btnDefaultValue.setText(Messages.getString("MenuItemForm.7")); //$NON-NLS-1$ priceTabScrollPane.setViewportView(priceTable); tabPrice.setLayout(new BorderLayout()); tabPrice.add(priceTabScrollPane, BorderLayout.CENTER); JPanel buttonPanel = new JPanel(); buttonPanel.add(btnNewPrice); buttonPanel.add(btnUpdatePrice); buttonPanel.add(btnDeletePrice); buttonPanel.add(btnAutoGenerate); tabPrice.add(buttonPanel, BorderLayout.SOUTH); tabGeneral.add(tabPrice, "cell 0 10,grow,span"); tabbedPane.addChangeListener(this); tabButtonStyle.setLayout(new MigLayout("insets 10", "[][]100[][][][]", "[][][center][][][]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ JLabel lblImage = new JLabel(Messages.getString("MenuItemForm.28")); //$NON-NLS-1$ lblImage.setHorizontalAlignment(SwingConstants.TRAILING); tabButtonStyle.add(lblImage, "cell 0 0,right"); //$NON-NLS-1$ lblImagePreview = new JLabel(""); //$NON-NLS-1$ lblImagePreview.setHorizontalAlignment(JLabel.CENTER); lblImagePreview.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); lblImagePreview.setPreferredSize(new Dimension(100, 100)); tabButtonStyle.add(lblImagePreview, "cell 1 0"); //$NON-NLS-1$ JButton btnSelectImage = new JButton("..."); //$NON-NLS-1$ btnClearImage = new JButton(Messages.getString("MenuItemForm.34")); //$NON-NLS-1$ tabButtonStyle.add(btnClearImage, "cell 1 0"); //$NON-NLS-1$ tabButtonStyle.add(btnSelectImage, "cell 1 0"); //$NON-NLS-1$ tabButtonStyle.add(lblButtonColor, "cell 0 2,right"); //$NON-NLS-1$ tabButtonStyle.add(btnButtonColor, "cell 1 2,grow"); //$NON-NLS-1$ tabButtonStyle.add(lblTextColor, "cell 0 3,right"); //$NON-NLS-1$ tabButtonStyle.add(btnTextColor, "cell 1 3"); //$NON-NLS-1$ tabButtonStyle.add(cbShowTextWithImage, "cell 1 4"); //$NON-NLS-1$ btnTextColor.setPreferredSize(new Dimension(228, 50)); btnSelectImage.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { doSelectImageFile(); } }); btnClearImage.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { doClearImage(); } }); btnButtonColor.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Color color = JColorChooser.showDialog(POSUtil.getBackOfficeWindow(), Messages.getString("MenuItemForm.42"), btnButtonColor.getBackground()); //$NON-NLS-1$ btnButtonColor.setBackground(color); btnTextColor.setBackground(color); } }); btnTextColor.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Color color = JColorChooser.showDialog(POSUtil.getBackOfficeWindow(), Messages.getString("MenuItemForm.43"), btnTextColor.getForeground()); //$NON-NLS-1$ btnTextColor.setForeground(color); } }); tabbedPane.addTab(Messages.getString("MenuItemForm.26"), tabButtonStyle); //$NON-NLS-1$ }
From source file:game.Clue.ClueGameUI.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.j a v a2 s .c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonGroup2 = new javax.swing.ButtonGroup(); jPanel3 = new javax.swing.JPanel(); LoginPanel = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); jToggleButton3 = new javax.swing.JToggleButton(); jLabel12 = new javax.swing.JLabel(); jProgressBar1 = new javax.swing.JProgressBar(); CharacterSelectionPanel = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jToggleButton4 = new javax.swing.JToggleButton(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); jRadioButton3 = new javax.swing.JRadioButton(); jRadioButton4 = new javax.swing.JRadioButton(); jRadioButton5 = new javax.swing.JRadioButton(); jRadioButton6 = new javax.swing.JRadioButton(); jPanel2 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jScrollPane3 = new javax.swing.JScrollPane(); jTable3 = new javax.swing.JTable(); jLabel10 = new javax.swing.JLabel(); jScrollPane2 = new javax.swing.JScrollPane(); jTable2 = new javax.swing.JTable(); jPanel5 = new javax.swing.JPanel(); jLayeredPane5 = new javax.swing.JLayeredPane(); jButton2 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jToggleButton2 = new javax.swing.JToggleButton(); jButton6 = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jToggleButton1 = new javax.swing.JToggleButton(); jLabel11 = new javax.swing.JLabel(); jTextField3 = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jTextField4 = new javax.swing.JTextField(); jScrollPane4 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Clueless"); setBackground(new java.awt.Color(0, 0, 0)); setMaximumSize(new java.awt.Dimension(2147483647, 400)); setResizable(false); jPanel3.setMaximumSize(new java.awt.Dimension(2147483647, 400)); jPanel3.setLayout(new java.awt.CardLayout()); LoginPanel.setBackground(new java.awt.Color(51, 51, 51)); LoginPanel.setForeground(new java.awt.Color(255, 153, 153)); LoginPanel.setMaximumSize(new java.awt.Dimension(32767, 400)); LoginPanel.setPreferredSize(new java.awt.Dimension(729, 670)); LoginPanel.setLayout(null); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Name:"); LoginPanel.add(jLabel1); jLabel1.setBounds(20, 580, 35, 14); jTextField2.setMaximumSize(new java.awt.Dimension(6, 20)); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); LoginPanel.add(jTextField2); jTextField2.setBounds(90, 570, 110, 30); jToggleButton3.setText("Start/Join a game"); jToggleButton3.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jToggleButton3ItemStateChanged(evt); } }); jToggleButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton3ActionPerformed(evt); } }); LoginPanel.add(jToggleButton3); jToggleButton3.setBounds(40, 610, 130, 23); jLabel12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/logo-login3.jpg"))); // NOI18N jLabel12.setText("jLabel12"); jLabel12.setMaximumSize(new java.awt.Dimension(729, 670)); jLabel12.setMinimumSize(new java.awt.Dimension(729, 670)); jLabel12.setPreferredSize(new java.awt.Dimension(729, 670)); LoginPanel.add(jLabel12); jLabel12.setBounds(0, 0, 729, 670); LoginPanel.add(jProgressBar1); jProgressBar1.setBounds(40, 640, 146, 14); jPanel3.add(LoginPanel, "card4"); CharacterSelectionPanel.setBackground(new java.awt.Color(102, 153, 255)); CharacterSelectionPanel.setMaximumSize(new java.awt.Dimension(32767, 400)); CharacterSelectionPanel.setPreferredSize(new java.awt.Dimension(729, 670)); jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel3.setIcon( new javax.swing.ImageIcon(getClass().getResource("/resources/characterImages/ColonelMustard.png"))); // NOI18N jLabel3.setPreferredSize(new java.awt.Dimension(175, 233)); buttonGroup2.add(jToggleButton4); jToggleButton4.setText("Next"); jToggleButton4.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jToggleButton4ItemStateChanged(evt); } }); jToggleButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton4ActionPerformed(evt); } }); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setText("Character Selection"); jLabel4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel5.setIcon( new javax.swing.ImageIcon(getClass().getResource("/resources/characterImages/MissScarlett.png"))); // NOI18N jLabel5.setToolTipText(""); jLabel5.setPreferredSize(new java.awt.Dimension(175, 233)); jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel6.setIcon( new javax.swing.ImageIcon(getClass().getResource("/resources/characterImages/MrGreen.png"))); // NOI18N jLabel6.setPreferredSize(new java.awt.Dimension(175, 233)); jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel7.setIcon( new javax.swing.ImageIcon(getClass().getResource("/resources/characterImages/MrsPeacock.png"))); // NOI18N jLabel7.setPreferredSize(new java.awt.Dimension(175, 233)); jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel8.setIcon( new javax.swing.ImageIcon(getClass().getResource("/resources/characterImages/MrsWhite.png"))); // NOI18N jLabel8.setPreferredSize(new java.awt.Dimension(175, 233)); jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel9.setIcon( new javax.swing.ImageIcon(getClass().getResource("/resources/characterImages/ProfessorPlum.png"))); // NOI18N jLabel9.setPreferredSize(new java.awt.Dimension(175, 233)); buttonGroup2.add(jRadioButton1); buttonGroup2.add(jRadioButton2); buttonGroup2.add(jRadioButton3); jRadioButton3.setToolTipText(""); buttonGroup2.add(jRadioButton4); buttonGroup2.add(jRadioButton5); buttonGroup2.add(jRadioButton6); javax.swing.GroupLayout CharacterSelectionPanelLayout = new javax.swing.GroupLayout( CharacterSelectionPanel); CharacterSelectionPanel.setLayout(CharacterSelectionPanelLayout); CharacterSelectionPanelLayout.setHorizontalGroup(CharacterSelectionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CharacterSelectionPanelLayout .createSequentialGroup().addGap(47, 47, 47) .addGroup(CharacterSelectionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup() .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup() .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(31, 31, 31).addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE) .addGroup(CharacterSelectionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(85, 85, 85)) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup().addGap(131, 131, 131) .addComponent(jRadioButton1).addGap(170, 170, 170).addComponent(jRadioButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jRadioButton3).addGap(162, 162, 162)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, CharacterSelectionPanelLayout .createSequentialGroup().addGap(131, 131, 131).addComponent(jRadioButton4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jRadioButton5).addGap(169, 169, 169).addComponent(jRadioButton6) .addGap(171, 171, 171)) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup() .addGroup(CharacterSelectionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup() .addGap(158, 158, 158).addComponent(jLabel4)) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup() .addGap(329, 329, 329).addComponent(jToggleButton4))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); CharacterSelectionPanelLayout.setVerticalGroup( CharacterSelectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup() .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32) .addGroup(CharacterSelectionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(CharacterSelectionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup() .addGap(5, 5, 5).addComponent(jRadioButton1)) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup() .addGap(7, 7, 7).addComponent(jRadioButton2)) .addGroup(CharacterSelectionPanelLayout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jRadioButton3))) .addGap(18, 18, 18) .addGroup(CharacterSelectionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(CharacterSelectionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jRadioButton6).addComponent(jRadioButton5) .addComponent(jRadioButton4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jToggleButton4).addContainerGap(25, Short.MAX_VALUE))); jPanel3.add(CharacterSelectionPanel, "card5"); jPanel2.setBackground(new java.awt.Color(204, 204, 204)); jPanel2.setMaximumSize(new java.awt.Dimension(720, 400)); jPanel2.setPreferredSize(new java.awt.Dimension(729, 670)); jPanel4.setBackground(new java.awt.Color(204, 102, 0)); jTable1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { "Mrs.White", null }, { "Mr. Plum", null }, { "Miss Scarlet", null }, { "Mr. Green", null }, { "Mrs.Peacock", null }, { "Col. Mustard", null } }, new String[] { "SUSPECTS", "" }) { boolean[] canEdit = new boolean[] { false, true }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane1.setViewportView(jTable1); jTable3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jTable3.setModel( new javax.swing.table.DefaultTableModel( new Object[][] { { "Hall", null }, { "Lounge", null }, { "Library", null }, { "Kitchen", null }, { "Dining Room", null }, { "Billiard Room", null }, { "Study", null }, { "Ballroom", null }, { "Conservatory", null } }, new String[] { "ROOMS", "P1" })); jScrollPane3.setViewportView(jTable3); jLabel10.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N jLabel10.setText("Scorecard"); jTable2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jTable2.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { "CandleStick", null }, { "Knife", null }, { "LeadPipe", null }, { "Revolver", null }, { "Rope", null }, { "Wrench", null } }, new String[] { "WEAPONS", "" }) { boolean[] canEdit = new boolean[] { false, true }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane2.setViewportView(jTable2); jPanel5.setBackground(new java.awt.Color(51, 51, 51)); javax.swing.GroupLayout jLayeredPane5Layout = new javax.swing.GroupLayout(jLayeredPane5); jLayeredPane5.setLayout(jLayeredPane5Layout); jLayeredPane5Layout.setHorizontalGroup(jLayeredPane5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 701, Short.MAX_VALUE)); jLayeredPane5Layout.setVerticalGroup(jLayeredPane5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE)); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap() .addComponent(jLayeredPane5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel5Layout .createSequentialGroup().addGap(22, 22, 22).addComponent(jLayeredPane5).addContainerGap())); jLayeredPane5.addMouseListener(this); jLayeredPane5.addMouseMotionListener(this); jLayeredPane5.add(player, JLayeredPane.DRAG_LAYER); jButton2.setText("Make Accusation"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton4.setText("(unused) jButton4"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jButton5.setText("Make A Suggestion"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/cards/Ballroom.PNG"))); // NOI18N jLabel2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel2MouseClicked(evt); } }); jLabel15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/cards/Candlestick.PNG"))); // NOI18N jLabel15.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel15MouseClicked(evt); } }); jLabel16.setIcon( new javax.swing.ImageIcon(getClass().getResource("/resources/characterImages/ColonelMustard.png"))); // NOI18N jLabel16.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel16MouseClicked(evt); } }); jToggleButton2.setText("jToggleButton2"); jToggleButton2.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jToggleButton2ItemStateChanged(evt); } }); jToggleButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton2ActionPerformed(evt); } }); jButton6.setText("Move"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout .createSequentialGroup().addGap(25, 25, 25) .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jButton2) .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jToggleButton2).addComponent(jButton4) .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel4Layout.createSequentialGroup().addGap(21, 21, 21).addComponent(jLabel10))) .addGap(11, 11, 11) .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel15).addComponent(jLabel2).addComponent(jLabel16)) .addContainerGap(3138, Short.MAX_VALUE))); jPanel4Layout .setVerticalGroup(jPanel4Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGap(23, 23, 23).addComponent(jLabel10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(37, 37, 37).addComponent(jToggleButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton6).addGap(3, 3, 3)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup().addGap(59, 59, 59).addComponent(jLabel2) .addGap(58, 58, 58).addComponent(jLabel15).addGap(18, 18, 18) .addComponent(jLabel16) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))); jPanel2Layout .setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanel3.add(jPanel2, "card3"); jPanel1.setMaximumSize(new java.awt.Dimension(32767, 400)); jPanel1.setPreferredSize(new java.awt.Dimension(729, 670)); jButton1.setText("Connect to Server"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton3.setText("Send Message to Server"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jToggleButton1.setText("Go To Gameboard"); jToggleButton1.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jToggleButton1ItemStateChanged(evt); } }); jToggleButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton1ActionPerformed(evt); } }); jLabel11.setText("Technical Page for Server Communication..Wont be used in Game"); jTextField3.setText("192.168.1.8"); jLabel13.setText("IP address:"); jLabel14.setText("Port:"); jTextField4.setText("8888"); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane4.setViewportView(jTextArea1); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(180, 180, 180).addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jToggleButton1).addComponent(jLabel11) .addGroup(jPanel1Layout.createSequentialGroup().addComponent(jButton1) .addGap(42, 42, 42) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel13).addComponent(jLabel14)) .addGap(18, 18, 18) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup().addGap(50, 50, 50).addComponent( jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup(jPanel1Layout.createSequentialGroup().addGap(247, 247, 247) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3).addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(211, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(25, 25, 25).addComponent(jLabel11) .addGap(101, 101, 101) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel13)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel14) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(8, 8, 8).addComponent(jToggleButton1).addGap(41, 41, 41) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton3).addContainerGap(190, Short.MAX_VALUE))); jPanel3.add(jPanel1, "card2"); getContentPane().add(jPanel3, java.awt.BorderLayout.PAGE_END); pack(); }