/** @param frameName title name for frame */ public ShowSavedResults(String frameName) { super(frameName); aboutRes = new JTextArea( "Select a result set from" + "\nthose listed and details" + "\nof that analysis will be" + "\nshown here. Then you can" + "\neither delete or view those" + "\nresults using the buttons below."); aboutScroll = new JScrollPane(aboutRes); ss = new JScrollPane(sp); ss.getViewport().setBackground(Color.white); // resMenu.setLayout(new FlowLayout(FlowLayout.LEFT,10,1)); ClassLoader cl = getClass().getClassLoader(); rfii = new ImageIcon(cl.getResource("images/Refresh_button.gif")); // results status resButtonStatus = new JPanel(new BorderLayout()); Border loweredbevel = BorderFactory.createLoweredBevelBorder(); Border raisedbevel = BorderFactory.createRaisedBevelBorder(); Border compound = BorderFactory.createCompoundBorder(raisedbevel, loweredbevel); statusField = new JTextField(); statusField.setBorder(compound); statusField.setEditable(false); }
protected void setUpSRSFrame(URL url, String search) throws IOException { if (BigPane.srsFrame == null) { BigPane.setUpSRSFrame((2 * desktop.getHeight()) / 3, desktop); Border loweredbevel = BorderFactory.createLoweredBevelBorder(); Border raisedbevel = BorderFactory.createRaisedBevelBorder(); Border compound = BorderFactory.createCompoundBorder(raisedbevel, loweredbevel); JTextField statusField = new JTextField(); statusField.setBorder(compound); statusField.setEditable(false); BigPane.srsFrame.getContentPane().add(statusField, BorderLayout.SOUTH); } Annotation edPane = new Annotation(url); JScrollPane jsp = new JScrollPane(edPane); JTabbedPane jtab = (JTabbedPane) BigPane.srsFrame.getContentPane().getComponent(0); jtab.insertTab(search, null, jsp, null, 0); BigPane.srsFrame.setVisible(true); }
public static void main(String[] args) { // create a JFrame to hold everything JFrame frame = new JFrame("Borders"); // Create labels with borders. int center = SwingConstants.CENTER; JLabel labelOne = new JLabel("raised BevelBorder", center); labelOne.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); JLabel labelTwo = new JLabel("EtchedBorder", center); labelTwo.setBorder(BorderFactory.createEtchedBorder()); JLabel labelThree = new JLabel("MatteBorder", center); labelThree.setBorder(BorderFactory.createMatteBorder(10, 10, 10, 10, Color.pink)); JLabel labelFour = new JLabel("TitledBorder", center); Border etch = BorderFactory.createEtchedBorder(); labelFour.setBorder(BorderFactory.createTitledBorder(etch, "Title")); JLabel labelFive = new JLabel("TitledBorder", center); Border low = BorderFactory.createLoweredBevelBorder(); labelFive.setBorder( BorderFactory.createTitledBorder(low, "Title", TitledBorder.RIGHT, TitledBorder.BOTTOM)); JLabel labelSix = new JLabel("CompoundBorder", center); Border one = BorderFactory.createEtchedBorder(); Border two = BorderFactory.createMatteBorder(4, 4, 4, 4, Color.blue); labelSix.setBorder(BorderFactory.createCompoundBorder(one, two)); // add components to the content pane Container c = frame.getContentPane(); // unecessary in 1.5+ c.setLayout(new GridLayout(3, 2)); c.add(labelOne); c.add(labelTwo); c.add(labelThree); c.add(labelFour); c.add(labelFive); c.add(labelSix); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); }
void jbInit() throws Exception { titledBorder1 = new TitledBorder( BorderFactory.createLineBorder(new Color(153, 153, 153), 2), "Assembler messages"); this.getContentPane().setLayout(borderLayout1); this.setIconifiable(true); this.setMaximizable(true); this.setResizable(true); this.setTitle("EDIT"); splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); splitPane.setDividerLocation(470); sourceArea.setFont(new java.awt.Font("Monospaced", 0, 12)); controlPanel.setLayout(gridBagLayout1); controlPanel.setBorder(BorderFactory.createLoweredBevelBorder()); positionPanel.setLayout(gridBagLayout2); fileLabel.setText("Source file:"); fileText.setEditable(false); browseButton.setSelected(false); browseButton.setText("Browse ..."); assembleButton.setEnabled(false); assembleButton.setText("Assemble file"); saveButton.setEnabled(false); saveButton.setText("Save file"); lineLabel.setText("Line:"); lineText.setMinimumSize(new Dimension(50, 20)); lineText.setPreferredSize(new Dimension(50, 20)); lineText.setEditable(false); columnLabel.setText("Column:"); columnText.setMinimumSize(new Dimension(41, 20)); columnText.setPreferredSize(new Dimension(41, 20)); columnText.setEditable(false); columnText.setText(""); messageScrollPane.setBorder(titledBorder1); messageScrollPane.setMinimumSize(new Dimension(33, 61)); messageScrollPane.setPreferredSize(new Dimension(60, 90)); optionsButton.setEnabled(false); optionsButton.setText("Assembler options ..."); messageScrollPane.getViewport().add(messageList, null); messageList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); this.getContentPane().add(splitPane, BorderLayout.CENTER); splitPane.add(textScrollPane, JSplitPane.TOP); splitPane.add(controlPanel, JSplitPane.BOTTOM); textScrollPane.getViewport().add(sourceArea, null); controlPanel.add( fileLabel, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); controlPanel.add( fileText, new GridBagConstraints( 1, 0, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); controlPanel.add( browseButton, new GridBagConstraints( 4, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); controlPanel.add( optionsButton, new GridBagConstraints( 2, 1, 1, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); controlPanel.add( assembleButton, new GridBagConstraints( 3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); controlPanel.add( saveButton, new GridBagConstraints( 4, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); controlPanel.add( positionPanel, new GridBagConstraints( 0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); positionPanel.add( lineLabel, new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); positionPanel.add( lineText, new GridBagConstraints( 1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0)); positionPanel.add( columnLabel, new GridBagConstraints( 2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0)); positionPanel.add( columnText, new GridBagConstraints( 3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0)); controlPanel.add( messageScrollPane, new GridBagConstraints( 0, 2, 5, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0)); }
/** This method is called from within the constructor to initialize the form. */ public void initComponents() { /** **************** The components ********************************* */ firstPanel = new JPanel(); firstPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 2)); // If put to False: we see the container's background firstPanel.setOpaque(false); // rows, columns, horizontalGap, verticalGap firstPanel.setLayout(new GridLayout(4, 2, 3, 3)); this.setLayout(new GridLayout(2, 1, 3, 3)); this.add(firstPanel); proxyStackNameLabel = new JLabel("Proxy stack name:"); proxyStackNameLabel.setToolTipText("The name of the stack to set"); // Alignment of the text proxyStackNameLabel.setHorizontalAlignment(AbstractButton.CENTER); // Color of the text proxyStackNameLabel.setForeground(Color.black); // Size of the text proxyStackNameLabel.setFont(new Font("Dialog", 1, 12)); // If put to true: we see the label's background proxyStackNameLabel.setOpaque(true); proxyStackNameLabel.setBackground(ProxyLauncher.labelBackGroundColor); proxyStackNameLabel.setBorder(ProxyLauncher.labelBorder); proxyStackNameTextField = new JTextField(20); proxyStackNameTextField.setHorizontalAlignment(AbstractButton.CENTER); proxyStackNameTextField.setFont(new Font("Dialog", 0, 14)); proxyStackNameTextField.setBackground(ProxyLauncher.textBackGroundColor); proxyStackNameTextField.setForeground(Color.black); proxyStackNameTextField.setBorder(BorderFactory.createLoweredBevelBorder()); firstPanel.add(proxyStackNameLabel); firstPanel.add(proxyStackNameTextField); proxyIPAddressLabel = new JLabel("Proxy IP address:"); proxyIPAddressLabel.setToolTipText("The address of the proxy to set"); // Alignment of the text proxyIPAddressLabel.setHorizontalAlignment(AbstractButton.CENTER); // Color of the text proxyIPAddressLabel.setForeground(Color.black); // Size of the text proxyIPAddressLabel.setFont(new Font("Dialog", 1, 12)); // If put to true: we see the label's background proxyIPAddressLabel.setOpaque(true); proxyIPAddressLabel.setBackground(ProxyLauncher.labelBackGroundColor); proxyIPAddressLabel.setBorder(ProxyLauncher.labelBorder); proxyIPAddressTextField = new JTextField(20); proxyIPAddressTextField.setHorizontalAlignment(AbstractButton.CENTER); proxyIPAddressTextField.setFont(new Font("Dialog", 0, 14)); proxyIPAddressTextField.setBackground(ProxyLauncher.textBackGroundColor); proxyIPAddressTextField.setForeground(Color.black); proxyIPAddressTextField.setBorder(BorderFactory.createLoweredBevelBorder()); firstPanel.add(proxyIPAddressLabel); firstPanel.add(proxyIPAddressTextField); outboundProxyLabel = new JLabel("Next hop (IP:port/protocol):"); outboundProxyLabel.setToolTipText( "Location where the message will be sent " + "if all the resolutions (DNS, router,...) fail. If not set: 404 will be replied"); // Alignment of the text outboundProxyLabel.setHorizontalAlignment(AbstractButton.CENTER); // Color of the text outboundProxyLabel.setForeground(Color.black); // Size of the text outboundProxyLabel.setFont(new Font("Dialog", 1, 12)); // If put to true: we see the label's background outboundProxyLabel.setOpaque(true); outboundProxyLabel.setBackground(ProxyLauncher.labelBackGroundColor); outboundProxyLabel.setBorder(ProxyLauncher.labelBorder); outboundProxyTextField = new JTextField(20); outboundProxyTextField.setHorizontalAlignment(AbstractButton.CENTER); outboundProxyTextField.setFont(new Font("Dialog", 0, 14)); outboundProxyTextField.setBackground(ProxyLauncher.textBackGroundColor); outboundProxyTextField.setForeground(Color.black); outboundProxyTextField.setBorder(BorderFactory.createLoweredBevelBorder()); firstPanel.add(outboundProxyLabel); firstPanel.add(outboundProxyTextField); routerClassLabel = new JLabel("The Router class name:"); routerClassLabel.setToolTipText( "The class name (full java package name) of the router" + " used to forward the messages"); // Alignment of the text routerClassLabel.setHorizontalAlignment(AbstractButton.CENTER); // Color of the text routerClassLabel.setForeground(Color.black); // Size of the text routerClassLabel.setFont(new Font("Dialog", 1, 12)); // If put to true: we see the label's background routerClassLabel.setOpaque(true); routerClassLabel.setBackground(ProxyLauncher.labelBackGroundColor); routerClassLabel.setBorder(ProxyLauncher.labelBorder); routerClassTextField = new JTextField(20); routerClassTextField.setHorizontalAlignment(AbstractButton.CENTER); routerClassTextField.setFont(new Font("Dialog", 0, 12)); routerClassTextField.setBackground(ProxyLauncher.textBackGroundColor); routerClassTextField.setForeground(Color.black); routerClassTextField.setBorder(BorderFactory.createLoweredBevelBorder()); firstPanel.add(routerClassLabel); firstPanel.add(routerClassTextField); JPanel panel = new JPanel(); // top, left, bottom, right panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 2)); // If put to False: we see the container's background panel.setOpaque(false); // rows, columns, horizontalGap, verticalGap panel.setLayout(new BorderLayout()); this.add(panel); JLabel lpLabel = new JLabel("Listening points list:"); lpLabel.setVisible(true); lpLabel.setToolTipText("The listening points of the proxy"); lpLabel.setHorizontalAlignment(AbstractButton.CENTER); lpLabel.setForeground(Color.black); lpLabel.setFont(new Font("Dialog", 1, 12)); lpLabel.setOpaque(true); lpLabel.setBackground(ProxyLauncher.labelBackGroundColor); lpLabel.setBorder(ProxyLauncher.labelBorder); panel.add(lpLabel, BorderLayout.NORTH); // this.add(listeningPointsList); JScrollPane scrollPane = new JScrollPane( listeningPointsList, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); panel.add(scrollPane, BorderLayout.CENTER); thirdPanel = new JPanel(); thirdPanel.setOpaque(false); // top, left, bottom, right thirdPanel.setBorder(BorderFactory.createEmptyBorder(3, 0, 5, 0)); thirdPanel.setLayout(new GridLayout(1, 2, 3, 3)); JButton addLPButton = new JButton(" Add "); addLPButton.setToolTipText("Add a listening point"); addLPButton.setFocusPainted(false); addLPButton.setFont(new Font("Dialog", 1, 16)); addLPButton.setBackground(ProxyLauncher.buttonBackGroundColor); addLPButton.setBorder(ProxyLauncher.buttonBorder); addLPButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { addLPButtonActionPerformed(evt); } }); thirdPanel.add(addLPButton); JButton removeLPButton = new JButton(" Remove "); removeLPButton.setToolTipText("Remove a listening point"); removeLPButton.setFocusPainted(false); removeLPButton.setFont(new Font("Dialog", 1, 16)); removeLPButton.setBackground(ProxyLauncher.buttonBackGroundColor); removeLPButton.setBorder(ProxyLauncher.buttonBorder); removeLPButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { removeLPButtonActionPerformed(evt); } }); thirdPanel.add(removeLPButton); panel.add(thirdPanel, BorderLayout.SOUTH); }
public PlayerView(String player) { playerName = new String(player); // Set-Up Top of Score Area namePanel = new JPanel(); nameText = new JLabel(player); nameText.setFont(ScoreFont); namePanel.setLayout(new BorderLayout()); namePanel.add(nameText, BorderLayout.CENTER); scorePanel = new JPanel(); scoreText = new JLabel(" 0"); scoreText.setFont(ScoreFont); scorePanel.setLayout(new BorderLayout()); scorePanel.add(scoreText, BorderLayout.CENTER); topPanel = new JPanel(); BoxLayout layout = new BoxLayout(topPanel, BoxLayout.LINE_AXIS); topPanel.setLayout(layout); topPanel.add(namePanel); topPanel.add(Box.createRigidArea(new Dimension(10, 0))); topPanel.add(scorePanel); topPanel.add(Box.createRigidArea(new Dimension(10, 0))); // // topPanel.setLayout( new BorderLayout()); // topPanel.add(namePanel, BorderLayout.WEST); // topPanel.add(scorePanel, BorderLayout.EAST); // // Create bordering for top panel Border raisedBevel, loweredBevel, compound; raisedBevel = BorderFactory.createRaisedBevelBorder(); loweredBevel = BorderFactory.createLoweredBevelBorder(); compound = BorderFactory.createCompoundBorder(raisedBevel, loweredBevel); topPanel.setBorder(compound); // Set-Up area to display word list wordPanel = new JPanel(); Border etched = BorderFactory.createEtchedBorder(); TitledBorder etchedTitle = BorderFactory.createTitledBorder(etched, "Word List"); etchedTitle.setTitleJustification(TitledBorder.RIGHT); wordPanel.setBorder(etchedTitle); myWordList = new ExpandableList(); myWordList.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String word = e.getActionCommand(); java.util.List<BoardCell> list = myFinder.cellsForWord(myBoard, word); myBoardPanel.highlightDice(list); } }); wordPanel.add( new JScrollPane( myWordList, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED)); setLayout(new BorderLayout(30, 30)); add(topPanel, BorderLayout.NORTH); add(wordPanel, BorderLayout.CENTER); }
private void jbInit() throws Exception { this.getContentPane().setLayout(gridBagLayout2); bottomPanel.setLayout(gridBagLayout1); messagePanel.setBorder(BorderFactory.createLoweredBevelBorder()); replaceButton.setToolTipText("Save the new trace replacing the old trace."); replaceButton.setText("Replace old trace"); replaceButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { replaceOldTrace(); } }); buttonPanel.setBorder(BorderFactory.createLoweredBevelBorder()); discardButton.setToolTipText("Discard the new trace"); discardButton.setText("Discard new trace"); discardButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { DoneReplayDialog.this.setVisible(false); } }); saveButton.setToolTipText("Save the new trace in a file."); saveButton.setText("Save as new file"); saveButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { saveNewToFile(); } }); this.setModal(true); this.setTitle("Replay Complete"); jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); jScrollPane1.setMinimumSize(new Dimension(200, 200)); jScrollPane1.setPreferredSize(new Dimension(200, 200)); jTextPane.setMinimumSize(new Dimension(25, 80)); jTextPane.setPreferredSize(new Dimension(40, 80)); tracePanel.setLayout(borderLayout1); commentPanel.setLayout(borderLayout3); jPanel6.setLayout(borderLayout2); jScrollPane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); jScrollPane2.setMinimumSize(new Dimension(200, 100)); jScrollPane2.setPreferredSize(new Dimension(200, 100)); jLabel1.setText("Comment"); jLabel2.setText("Traces (Old is Yellow, New is Pink)"); tracePanel.setBorder(BorderFactory.createEtchedBorder()); bottomPanel.setBorder(BorderFactory.createEtchedBorder()); commentPanel.setBorder(BorderFactory.createEtchedBorder()); this.getContentPane() .add( bottomPanel, new GridBagConstraints( 0, 3, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); buttonPanel.add(saveButton, null); buttonPanel.add(replaceButton, null); buttonPanel.add(discardButton, null); bottomPanel.add( messagePanel, new GridBagConstraints( 0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); messagePanel.add(messageLabel, null); this.getContentPane() .add( tracePanel, new GridBagConstraints( 0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); tracePanel.add(jScrollPane1, BorderLayout.CENTER); tracePanel.add(jLabel2, BorderLayout.NORTH); this.getContentPane() .add( commentPanel, new GridBagConstraints( 0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0)); commentPanel.add(jPanel6, BorderLayout.CENTER); jPanel6.add(jScrollPane2, BorderLayout.CENTER); commentPanel.add(jLabel1, BorderLayout.NORTH); jScrollPane2.getViewport().add(commentPane, null); jScrollPane1.getViewport().add(jTextPane, null); bottomPanel.add( buttonPanel, new GridBagConstraints( 0, 1, 2, 2, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); }