javax.swing.border.EtchedBorder Java Examples

The following examples show how to use javax.swing.border.EtchedBorder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HiscoresPanel.java    From osrsclient with GNU General Public License v2.0 7 votes vote down vote up
private void setup() {
       this.setLayout(new MigLayout("ins 5,center"));
       this.setBackground(Color.BLACK);
       usernameField = new JTextField();
       usernameField.setDocument(new LengthRestrictedDocument(12));
       usernameField.setBackground(new Color(101, 101, 101));
       usernameField.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));

       xpDisplay = new JLabel();
       rsnLabel = new JLabel("RSN:");
       rsnLabel.setForeground(Color.white);
       rsnLabel.setFont(new Font(rsnLabel.getFont().getFontName(), Font.BOLD, rsnLabel.getFont().getSize()));

       levelsDisplayPanel = new LevelsPanel();
       levelsDisplayPanel.setRolloverListener(this);

       levelInfoPanel = new LevelInfoPanel();

       searchButton = new JButton();
       searchButton.setIcon(new javax.swing.ImageIcon(getClass().getClassLoader().getResource("resources/searchiconsquare3.png")));
       //searchButton.setIcon(new javax.swing.ImageIcon(getClass().getClassLoader().getResource("resources/bwsearch2.png")));
searchButton.setBorderPainted(false);
       searchButton.setFocusPainted(false);
       searchButton.setContentAreaFilled(false);

       add(rsnLabel, "cell 0 0, gap 0, align left");
       add(usernameField, "width 60%, cell 1 0,align left, ");
       add(searchButton, "cell 2 0,align right ");
       add(levelsDisplayPanel, "width 100%, height 20%, cell 0 1, center,spanx");
       add(levelInfoPanel, "width 100%, height 15%, cell 0 2, center, spanx");
   }
 
Example #2
Source File: AddressBookPanel.java    From zencash-swing-wallet-ui with MIT License 6 votes vote down vote up
private JPanel buildButtonsPanel() {
    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
    panel.setLayout(new FlowLayout(FlowLayout.CENTER, 3, 3));
    
    JButton newContactButton = new JButton(langUtil.getString("panel.address.book.new.contact.button.text"));
    newContactButton.addActionListener(new NewContactActionListener());
    panel.add(newContactButton);
            
    sendCashButton = new JButton(langUtil.getString("panel.address.book.send.zen.button.text"));
    sendCashButton.addActionListener(new SendCashActionListener());
    sendCashButton.setEnabled(false);
    panel.add(sendCashButton);
    
    copyToClipboardButton = new JButton(langUtil.getString("panel.address.book.copy.clipboard.button.text"));
    copyToClipboardButton.setEnabled(false);
    copyToClipboardButton.addActionListener(new CopyToClipboardActionListener());
    panel.add(copyToClipboardButton);
    
    deleteContactButton = new JButton(langUtil.getString("panel.address.book.delete.contact.button.text"));
    deleteContactButton.setEnabled(false);
    deleteContactButton.addActionListener(new DeleteAddressActionListener());
    panel.add(deleteContactButton);
    
    return panel;
}
 
Example #3
Source File: JaxWsExplorerPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initUserComponents() {
    treeView = new BeanTreeView();
    treeView.setRootVisible(false);
    treeView.setPopupAllowed(false);
    treeView.setBorder(new EtchedBorder());
    
    java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 11);
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(treeView, gridBagConstraints);
    jLblTreeView.setLabelFor(treeView.getViewport().getView());
    treeView.getAccessibleContext().setAccessibleName(NbBundle.getMessage(JaxWsExplorerPanel.class, "ACSD_WebServicesTreeView"));
    treeView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(JaxWsExplorerPanel.class, "ACSD_WebServicesTreeView"));
}
 
Example #4
Source File: ImageLabel.java    From Open-Realms-of-Stars with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Construct an ImageLabel.
 * @param image Image to show
 * @param border Boolean is there a border or not
 */
public ImageLabel(final BufferedImage image, final boolean border) {
  super();
  ImageIcon icon = new ImageIcon(image, "");
  this.setIcon(icon);
  this.setImage(image);
  this.setBorder(border);
  this.setFillColor(null);
  if (isBorder()) {
    this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
  } else {
    this.setBorder(BorderFactory.createEmptyBorder());

  }

}
 
Example #5
Source File: AddressBookPanel.java    From hush-swing-wallet-ui with MIT License 6 votes vote down vote up
private JPanel buildButtonsPanel(
        final JButton newContactButton,
        final JButton sendCashButton,
        final JButton copyToClipboardButton,
        final JButton deleteContactButton
) {
    final JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
    panel.setLayout(new FlowLayout(FlowLayout.CENTER, 3, 3));

    panel.add(newContactButton);
    panel.add(sendCashButton);
    panel.add(copyToClipboardButton);
    panel.add(deleteContactButton);

    return panel;
}
 
Example #6
Source File: PortChooser.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Creates new form PortChooser */
public PortChooser(Node root) {
    initComponents();

    this.nodeAcceptor = new NodeAcceptorImpl();

    nodeDisplayPanel = new NodeDisplayPanel(root);
    nodeDisplayPanel.setBorder(new EtchedBorder());
    jPanelBeanTree.add(nodeDisplayPanel);
    nodeDisplayPanel.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent pce) {
            validateNodes();
        }
    });
    
    BeanTreeView btw = (BeanTreeView)nodeDisplayPanel.getComponent(0);
    jLabelDesc.setLabelFor(btw.getViewport().getView());
    
    validateNodes();
}
 
Example #7
Source File: IconButton.java    From Open-Realms-of-Stars with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Icon button which has only icon
 * @param notPressedImage Icon16x16
 * @param pressedImage Icon16x16
 * @param border Boolean
 * @param actionCommand String
 * @param parent Component
 */
public IconButton(final Icon16x16 notPressedImage,
    final Icon16x16 pressedImage, final boolean border,
    final String actionCommand, final Component parent) {
  super();
  ImageIcon icon = new ImageIcon(notPressedImage.getIcon(), "");
  this.setIcon(icon);
  this.setDisabledIcon(icon);
  this.setNotPressedImage(notPressedImage.getIcon());
  this.setPressedImage(pressedImage.getIcon());
  this.setActionCommand(actionCommand);
  this.setBorder(border);
  this.parent = parent;
  this.setBackground(GuiStatics.COLOR_SPACE_GREY_BLUE);
  if (border) {
    this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
  } else {
    this.setBorder(BorderFactory.createEmptyBorder());

  }
}
 
Example #8
Source File: Splash.java    From gate-core with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Constructor from owner, GraphicsConfiguration and content.
 */
public Splash(Window owner, GraphicsConfiguration gc, final JComponent content) {
  super(owner, "About...", ModalityType.APPLICATION_MODAL, gc);
  getContentPane().setLayout(new BorderLayout());
  content.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
  getContentPane().add(content, BorderLayout.CENTER);
  content.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      // when the content pane is clicked, hide it
      setVisible(false);
    }
  });
  validate();
  pack();
}
 
Example #9
Source File: testtable.java    From Hospital-Management-System with MIT License 6 votes vote down vote up
private void initializeUI() {
    setSize(400, 400);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setLayout(new BorderLayout(15, 15));

    JPanel top = new JPanel();
    top.setBorder(new LineBorder(Color.RED, 1, true));

    JPanel bottom = new JPanel();
    bottom.setBorder(new BevelBorder(BevelBorder.LOWERED));

    JPanel left = new JPanel();
    left.setBorder(new EtchedBorder(EtchedBorder.RAISED));

    JPanel right = new JPanel();
    right.setBorder(new MatteBorder(5, 5, 5, 5, Color.BLUE));

    JPanel center = new JPanel();
    center.setBorder(new BevelBorder(BevelBorder.RAISED));

    getContentPane().add(top, BorderLayout.NORTH);
    getContentPane().add(bottom, BorderLayout.SOUTH);
    getContentPane().add(left, BorderLayout.WEST);
    getContentPane().add(right, BorderLayout.EAST);
    getContentPane().add(center, BorderLayout.CENTER);
}
 
Example #10
Source File: BorderBuilders.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
static BorderBuilder fromField(Instance instance, String field, boolean uiresource, Heap heap) {
    Object _border = instance.getValueOfField(field);
    if (!(_border instanceof Instance)) return null;

    Instance border = (Instance)_border;

    // Make sure subclasses are listed before base class if using isSubclassOf
    if (DetailsUtils.isSubclassOf(border, BevelBorder.class.getName())) {
        return new BevelBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, MatteBorder.class.getName())) { // Must be before EmptyBorder (extends EmptyBorder)
        return new EmptyBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EmptyBorder.class.getName())) {
        return new MatteBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, EtchedBorder.class.getName())) {
        return new EtchedBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, LineBorder.class.getName())) {
        return new LineBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, TitledBorder.class.getName())) {
        return new TitledBorderBuilder(border, heap);
    } else if (DetailsUtils.isSubclassOf(border, CompoundBorder.class.getName())) {
        return new CompoundBorderBuilder(border, heap);
    }

    return null;
}
 
Example #11
Source File: TextAreaPage.java    From saros with GNU General Public License v2.0 6 votes vote down vote up
private void create() {
  setLayout(new BorderLayout());

  JPanel middlePanel = new JPanel();
  middlePanel.setBorder(new TitledBorder(new EtchedBorder(), title));

  display = new JTextArea(10, 48);
  display.getDocument().putProperty(DefaultEditorKit.EndOfLineStringProperty, "\n");
  display.setEditable(false);
  display.setForeground(fontColor);

  JScrollPane scroll = new JBScrollPane(display);
  scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
  middlePanel.add(scroll);

  add(middlePanel, BorderLayout.CENTER);

  JPanel progressPanel = new JPanel();
  progressPanel.setLayout(new BoxLayout(progressPanel, BoxLayout.Y_AXIS));
}
 
Example #12
Source File: TemplateWizard1.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Prepares decription area with html browser inside.
 * Executed in other then event dispatch thread.
 */
public void construct() {
    initData = new InitData();
    initData.browser = new HtmlBrowser(false, false);
    initData.browser.setName("browser");
    initData.noDescMsg = NbBundle.getBundle(TemplateWizard1.class).
                        getString("MSG_NoDescription");
    initData.noDescBorder = new EtchedBorder();

    // override the Swing default CSS to make the HTMLEditorKit use the
    // same font as the rest of the UI
    
    Component comp = initData.browser.getBrowserComponent();
    if (! (comp instanceof javax.swing.JEditorPane))
        return;

    javax.swing.text.EditorKit kit = ((javax.swing.JEditorPane) comp).getEditorKitForContentType("text/html"); // NOI18N
    if (! (kit instanceof javax.swing.text.html.HTMLEditorKit))
        return;

    javax.swing.text.html.HTMLEditorKit htmlkit = (javax.swing.text.html.HTMLEditorKit) kit;

    // XXX the style sheet is shared by all HTMLEditorKits.  We must
    // detect if it has been tweaked by ourselves or someone else
    // (template description for example) and avoid doing the same
    // thing again
    
    if (htmlkit.getStyleSheet().getStyleSheets() != null)
        return;
    
    javax.swing.text.html.StyleSheet css = new javax.swing.text.html.StyleSheet();
    java.awt.Font f = new javax.swing.JTextArea().getFont();
    css.addRule(new StringBuffer("body { font-size: ").append(f.getSize()) // NOI18N
                .append("; font-family: ").append(f.getName()).append("; }").toString()); // NOI18N
    css.addStyleSheet(htmlkit.getStyleSheet());
    htmlkit.setStyleSheet(css);
}
 
Example #13
Source File: MagicToggleButton.java    From nextreports-designer with Apache License 2.0 5 votes vote down vote up
private void buttonInit() {
//        this.setBorder(new BevelBorder(BevelBorder.RAISED));
        this.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
        this.setBorderPainted(false);
        this.setFocusPainted(false);
//        this.setMargin(new Insets(2, 2, 2, 2));

        addMouseListener(this);
    }
 
Example #14
Source File: NbTheme.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private final void handleEtchedBorder (org.xml.sax.AttributeList atts) {
    String key = atts.getValue (KEY_ATTR);
    int i = EtchedBorder.LOWERED;
    String type = atts.getValue (TYPE_ATTR);
    if (type != null) 
        i = type.equals (TYPE_LOWERED) ? EtchedBorder.LOWERED : EtchedBorder.RAISED;
    BorderUIResource.EtchedBorderUIResource resource = new BorderUIResource.EtchedBorderUIResource (i);
    defaults.put (key, resource);
}
 
Example #15
Source File: BorderBuilders.java    From netbeans with Apache License 2.0 5 votes vote down vote up
EtchedBorderBuilder(Instance instance, Heap heap) {
    super(instance, heap);
    
    etchType = DetailsUtils.getIntFieldValue(instance, "etchType", EtchedBorder.LOWERED);
    highlight = ColorBuilder.fromField(instance, "highlight", heap);
    shadow = ColorBuilder.fromField(instance, "shadow", heap);
}
 
Example #16
Source File: DetailsDisplay.java    From GpsPrune with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Make a details subpanel
 * @param inNameKey key to use for top label
 * @param inFont font for top label
 * @return panel with correct layout, label
 */
private static JPanel makeDetailsPanel(String inNameKey, Font inFont)
{
	JPanel detailsPanel = new JPanel();
	detailsPanel.setLayout(new BoxLayout(detailsPanel, BoxLayout.Y_AXIS));
	detailsPanel.setBorder(BorderFactory.createCompoundBorder(
		BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), BorderFactory.createEmptyBorder(3, 3, 3, 3))
	);
	JLabel detailsLabel = new JLabel(I18nManager.getText(inNameKey));
	detailsLabel.setFont(inFont);
	detailsPanel.add(detailsLabel);
	return detailsPanel;
}
 
Example #17
Source File: MemoryMonitor.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public MemoryMonitor() {
    setLayout(new BorderLayout());
    setBorder(new TitledBorder(new EtchedBorder(), "Memory Monitor"));
    add(surf = new Surface());
    controls = new JPanel();
    controls.setPreferredSize(new Dimension(135,80));
    Font font = new Font("serif", Font.PLAIN, 10);
    JLabel label = new JLabel("Sample Rate");
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(label);
    tf = new JTextField("1000");
    tf.setPreferredSize(new Dimension(45,20));
    controls.add(tf);
    controls.add(label = new JLabel("ms"));
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(dateStampCB);
    dateStampCB.setFont(font);
    addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
           removeAll();
           if ((doControls = !doControls)) {
               surf.stop();
               add(controls);
           } else {
               try {
                   surf.sleepAmount = Long.parseLong(tf.getText().trim());
               } catch (Exception ex) {}
               surf.start();
               add(surf);
           }
           validate();
           repaint();
        }
    });
}
 
Example #18
Source File: MenuComboBox.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Instantiates a new combo menu.
 *
 * @param label the label
 */
public ComboMenu(String label) {
    super(label);
    iconRenderer = new ArrowIcon(SwingConstants.SOUTH, true);
    setBorder(new EtchedBorder());
    setIcon(new BlankIcon(null, 11));
    setHorizontalTextPosition(JButton.LEFT);
    setFocusPainted(true);
}
 
Example #19
Source File: PickList.java    From JPPF with Apache License 2.0 5 votes vote down vote up
/**
 * Create a new {@link JList} the list of available items.
 * @param list the list to setup.
 * @param title the list title, may be {@code null}.
 * @param listener a list selection listener.
 * @return the list that was created.
 */
private JComponent setupList(final JList<T> list, final String title, final ListSelectionListener listener) {
  list.setModel(new DefaultListModel<T>());
  list.addListSelectionListener(listener);
  list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  list.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED), title == null ? "" : title));
  final JScrollPane scrollPane = new JScrollPane(list);
  scrollPane.setBorder(BorderFactory.createEmptyBorder());
  GuiUtils.adjustScrollbarsThickness(scrollPane);
  scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
  list.setCellRenderer(new TooltippedListCellRenderer());
  return scrollPane;
}
 
Example #20
Source File: StatusBar.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
public StatusBar() {

    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    setBorder(new EtchedBorder());

    statusTextPanel = new JPanel();
    statusTextPanel.setLayout(new BoxLayout(statusTextPanel, BoxLayout.X_AXIS));
    statusTextPanel.setBorder(new EtchedBorder(EtchedBorder.RAISED));

    statusTextLabel = new JLabel();
    statusTextLabel.setFont(statusBarFont);
    statusTextLabel.setMinimumSize(new Dimension(100, STATUS_BAR_HEIGHT));
    statusTextLabel.setPreferredSize(new Dimension(3200, STATUS_BAR_HEIGHT));

    statusTextPanel.add(Box.createRigidArea(new Dimension(5, STATUS_BAR_HEIGHT)));
    statusTextPanel.add(statusTextLabel);

    add(statusTextPanel);

    memoryLabel = new LabeledProgressBar();
    memoryPanel = new JPanel();
    memoryPanel.setLayout(new BoxLayout(memoryPanel, BoxLayout.X_AXIS));
    memoryPanel.setBorder(new EtchedBorder(EtchedBorder.RAISED));
    memoryPanel.add(Box.createRigidArea(new Dimension(10, STATUS_BAR_HEIGHT)));
    memoryPanel.add(memoryLabel);
    memoryPanel.add(Box.createRigidArea(new Dimension(10, STATUS_BAR_HEIGHT)));

    memoryLabel.addMouseListener(this);

    add(memoryPanel);

    Thread memoryLabelUpdaterThread = new Thread(this, "Memory label updater thread");
    memoryLabelUpdaterThread.start();

  }
 
Example #21
Source File: MemoryMonitor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public MemoryMonitor() {
    setLayout(new BorderLayout());
    setBorder(new TitledBorder(new EtchedBorder(), "Memory Monitor"));
    add(surf = new Surface());
    controls = new JPanel();
    controls.setPreferredSize(new Dimension(135,80));
    Font font = new Font("serif", Font.PLAIN, 10);
    JLabel label = new JLabel("Sample Rate");
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(label);
    tf = new JTextField("1000");
    tf.setPreferredSize(new Dimension(45,20));
    controls.add(tf);
    controls.add(label = new JLabel("ms"));
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(dateStampCB);
    dateStampCB.setFont(font);
    addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
           removeAll();
           if ((doControls = !doControls)) {
               surf.stop();
               add(controls);
           } else {
               try {
                   surf.sleepAmount = Long.parseLong(tf.getText().trim());
               } catch (Exception ex) {}
               surf.start();
               add(surf);
           }
           validate();
           repaint();
        }
    });
}
 
Example #22
Source File: GeneralSettingsUI.java    From LoboBrowser with MIT License 5 votes vote down vote up
private Component getStartupGroupBox() {
  final Box startupGroupBox = new Box(BoxLayout.Y_AXIS);
  startupGroupBox.setBorder(new TitledBorder(new EtchedBorder(), "Startup"));
  final Box startupPagesBox = new Box(BoxLayout.X_AXIS);
  final JLabel pagesLabel = new JLabel("Pages:");
  pagesLabel.setToolTipText("Up to " + MAX_STARTUP_PAGES + " pages launched when you first run the browser.");
  startupPagesBox.add(pagesLabel);
  startupPagesBox.add(this.startupPagesStringListControl);
  startupGroupBox.add(startupPagesBox);
  return startupGroupBox;
}
 
Example #23
Source File: MemoryMonitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public MemoryMonitor() {
    setLayout(new BorderLayout());
    setBorder(new TitledBorder(new EtchedBorder(), "Memory Monitor"));
    add(surf = new Surface());
    controls = new JPanel();
    controls.setPreferredSize(new Dimension(135,80));
    Font font = new Font("serif", Font.PLAIN, 10);
    JLabel label = new JLabel("Sample Rate");
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(label);
    tf = new JTextField("1000");
    tf.setPreferredSize(new Dimension(45,20));
    controls.add(tf);
    controls.add(label = new JLabel("ms"));
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(dateStampCB);
    dateStampCB.setFont(font);
    addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
           removeAll();
           if ((doControls = !doControls)) {
               surf.stop();
               add(controls);
           } else {
               try {
                   surf.sleepAmount = Long.parseLong(tf.getText().trim());
               } catch (Exception ex) {}
               surf.start();
               add(surf);
           }
           validate();
           repaint();
        }
    });
}
 
Example #24
Source File: MemoryMonitor.java    From biojava with GNU Lesser General Public License v2.1 5 votes vote down vote up
public MemoryMonitor() {
	setLayout(new BorderLayout());
	setBorder(new TitledBorder(new EtchedBorder(), "Memory Monitor"));
	add(surf = new Surface());
	controls = new JPanel();
	controls.setPreferredSize(new Dimension(135,80));
	Font font = new Font("serif", Font.PLAIN, 10);
	JLabel label = new JLabel("Sample Rate");
	label.setFont(font);
	label.setForeground(Color.black);
	controls.add(label);
	tf = new JTextField("1000");
	tf.setPreferredSize(new Dimension(45,20));
	controls.add(tf);
	controls.add(label = new JLabel("ms"));
	label.setFont(font);
	label.setForeground(Color.black);
	controls.add(dateStampCB);
	dateStampCB.setFont(font);
	addMouseListener(new MouseAdapter() {
		@Override
		public void mouseClicked(MouseEvent e) {
			removeAll();
			if ((doControls = !doControls)) {
				surf.stop();
				add(controls);
			} else {
				try {
					surf.sleepAmount = Long.parseLong(tf.getText().trim());
				} catch (Exception ex) {}
				surf.start();
				add(surf);
			}
			validate();
			repaint();
		}
	});
}
 
Example #25
Source File: MemoryMonitor.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public MemoryMonitor() {
    setLayout(new BorderLayout());
    setBorder(new TitledBorder(new EtchedBorder(), "Memory Monitor"));
    add(surf = new Surface());
    controls = new JPanel();
    controls.setPreferredSize(new Dimension(135,80));
    Font font = new Font("serif", Font.PLAIN, 10);
    JLabel label = new JLabel("Sample Rate");
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(label);
    tf = new JTextField("1000");
    tf.setPreferredSize(new Dimension(45,20));
    controls.add(tf);
    controls.add(label = new JLabel("ms"));
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(dateStampCB);
    dateStampCB.setFont(font);
    addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
           removeAll();
           if ((doControls = !doControls)) {
               surf.stop();
               add(controls);
           } else {
               try {
                   surf.sleepAmount = Long.parseLong(tf.getText().trim());
               } catch (Exception ex) {}
               surf.start();
               add(surf);
           }
           validate();
           repaint();
        }
    });
}
 
Example #26
Source File: MainView.java    From hortonmachine with GNU General Public License v3.0 5 votes vote down vote up
public JPanel createmapPaneHolder()
{
   _mapPaneHolder.setName("mapPaneHolder");
   EtchedBorder etchedborder1 = new EtchedBorder(EtchedBorder.LOWERED,null,null);
   _mapPaneHolder.setBorder(etchedborder1);
   FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0)","CENTER:DEFAULT:GROW(1.0)");
   CellConstraints cc = new CellConstraints();
   _mapPaneHolder.setLayout(formlayout1);

   addFillComponents(_mapPaneHolder,new int[]{ 1 },new int[]{ 1 });
   return _mapPaneHolder;
}
 
Example #27
Source File: UIUtilities.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Set up the user interface.
 */
public static void setupUI() {
    try {
        final String classname = UIManager.getSystemLookAndFeelClassName();
        UIManager.setLookAndFeel(classname);
    }
    catch (Exception e) { 
        e.printStackTrace();
    }

    final UIDefaults defaults = UIManager.getDefaults();

    defaults.put(
        "PopupMenu.border", 
        new BorderUIResource.EtchedBorderUIResource(
            EtchedBorder.RAISED, defaults.getColor("controlShadow"), 
            defaults.getColor("controlLtHighlight")
        )
    );

    final MatteBorder matteborder = new MatteBorder(1, 1, 1, 1, Color.black);
    final EmptyBorder emptyborder = new MatteBorder(2, 2, 2, 2, defaults.getColor("control"));
    final BorderUIResource.CompoundBorderUIResource compBorder
        = new BorderUIResource.CompoundBorderUIResource(emptyborder, matteborder);
    final BorderUIResource.EmptyBorderUIResource emptyBorderUI
        = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);
    defaults.put("SplitPane.border", emptyBorderUI);
    defaults.put("Table.scrollPaneBorder", emptyBorderUI);
    defaults.put("ComboBox.border", compBorder);
    defaults.put("TextField.border", compBorder);
    defaults.put("TextArea.border", compBorder);
    defaults.put("CheckBox.border", compBorder);
    defaults.put("ScrollPane.border", emptyBorderUI);

}
 
Example #28
Source File: Trainer.java    From audiveris with GNU Affero General Public License v3.0 5 votes vote down vote up
TitledPanel (String title)
{
    setBorder(
            BorderFactory.createTitledBorder(
                    new EtchedBorder(),
                    title,
                    TitledBorder.CENTER,
                    TitledBorder.TOP));
    setInsets(30, 10, 10, 10); // TLBR
}
 
Example #29
Source File: MemoryMonitor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public MemoryMonitor() {
    setLayout(new BorderLayout());
    setBorder(new TitledBorder(new EtchedBorder(), "Memory Monitor"));
    add(surf = new Surface());
    controls = new JPanel();
    controls.setPreferredSize(new Dimension(135,80));
    Font font = new Font("serif", Font.PLAIN, 10);
    JLabel label = new JLabel("Sample Rate");
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(label);
    tf = new JTextField("1000");
    tf.setPreferredSize(new Dimension(45,20));
    controls.add(tf);
    controls.add(label = new JLabel("ms"));
    label.setFont(font);
    label.setForeground(Color.red);
    controls.add(dateStampCB);
    dateStampCB.setFont(font);
    addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
           removeAll();
           if ((doControls = !doControls)) {
               surf.stop();
               add(controls);
           } else {
               try {
                   surf.sleepAmount = Long.parseLong(tf.getText().trim());
               } catch (Exception ex) {}
               surf.start();
               add(surf);
           }
           validate();
           repaint();
        }
    });
}
 
Example #30
Source File: NPController.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
protected void makeUI() {
  setLayout(new BorderLayout());

  JPanel statusPanel = new JPanel(new BorderLayout());
  statusPanel.setBorder(new EtchedBorder());
  JLabel positionLabel = new JLabel("position");
  statusPanel.add(positionLabel, BorderLayout.CENTER);

  np.setPositionLabel(positionLabel);
  add(toolPanel, BorderLayout.NORTH);
  add(np, BorderLayout.CENTER);
  add(statusPanel, BorderLayout.SOUTH);
}