类javax.swing.border.EtchedBorder源码实例Demo

下面列出了怎么用javax.swing.border.EtchedBorder的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Hospital-Management-System   文件: testtable.java
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);
}
 
源代码2 项目: Open-Realms-of-Stars   文件: IconButton.java
/**
 * 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());

  }
}
 
源代码3 项目: visualvm   文件: BorderBuilders.java
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;
}
 
源代码4 项目: saros   文件: TextAreaPage.java
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));
}
 
源代码5 项目: netbeans   文件: PortChooser.java
/** 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();
}
 
源代码6 项目: netbeans   文件: JaxWsExplorerPanel.java
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"));
}
 
源代码7 项目: Open-Realms-of-Stars   文件: ImageLabel.java
/**
 * 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());

  }

}
 
源代码8 项目: hush-swing-wallet-ui   文件: AddressBookPanel.java
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;
}
 
源代码9 项目: gate-core   文件: Splash.java
/**
 * 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();
}
 
源代码10 项目: zencash-swing-wallet-ui   文件: AddressBookPanel.java
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;
}
 
源代码11 项目: netcdf-java   文件: NPController.java
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);
}
 
源代码12 项目: openAGV   文件: OpenTCSView.java
private void configureToolBarButtons(JToolBar bar) {
  final Dimension dimButton = new Dimension(32, 34);
  for (Component comp : bar.getComponents()) {
    if (comp instanceof JButton || comp instanceof JToggleButton) {
      JComponent tbButton = (JComponent) comp;
      tbButton.setMaximumSize(dimButton);
      tbButton.setPreferredSize(dimButton);
      tbButton.setBorder(new EtchedBorder());
    }
  }
}
 
源代码13 项目: keystore-explorer   文件: DUpgradeCryptoStrength.java
public PolicyZipDropTarget() {
	policyZipAccepted = false;
	ImageIcon icon = new ImageIcon(getClass().getResource("images/drag_policy_here.png"));
	setIcon(icon);
	setBorder(new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5)));
	setOpaque(true);
	setBackground(Color.WHITE);

	// Make this label a drop target and its own listener
	new DropTarget(this, this);
}
 
源代码14 项目: dragonwell8_jdk   文件: MemoryMonitor.java
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();
        }
    });
}
 
源代码15 项目: osrsclient   文件: HiscoresPanel.java
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");
   }
 
源代码16 项目: ghidra   文件: OptionsEditorPanel.java
private Component buildOptionGroupPanel(List<Option> optionGroup) {

		JPanel panel = new JPanel(getBestLayout());
		String group = optionGroup.get(0).getGroup();

		panel.setBorder(createBorder(group));
		for (Option option : optionGroup) {
			panel.add(new GLabel(option.getName(), SwingConstants.RIGHT));
			Component editorComponent = getEditorComponent(option);
			editorComponent.setName(option.getName()); // set the component name to the option name
			panel.add(editorComponent);
		}

		if (needsSelectAllDeselectAllButton(optionGroup)) {
			JPanel wrapperPanel = new JPanel(new BorderLayout());
			wrapperPanel.add(panel, BorderLayout.CENTER);
			List<JCheckBox> list = findAllCheckBoxes(panel);
			JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 5));
			buttonPanel.add(buildSelectAll(list));
			buttonPanel.add(buildDeselectAll(list));
			wrapperPanel.add(buttonPanel, BorderLayout.SOUTH);
			Border etchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
			Border marginBorder = BorderFactory.createEmptyBorder(10, 0, 10, 10);
			panel.setBorder(BorderFactory.createCompoundBorder(etchedBorder, marginBorder));
			buttonPanel.setBorder(BorderFactory.createEmptyBorder(20, 0, 0, 0));
			return wrapperPanel;
		}

		return panel;
	}
 
源代码17 项目: TencentKona-8   文件: MemoryMonitor.java
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();
        }
    });
}
 
源代码18 项目: GpsPrune   文件: PointTypeSelector.java
/**
 * Constructor
 */
public PointTypeSelector()
{
	createComponents();
	setBorder(BorderFactory.createCompoundBorder(
		BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), BorderFactory.createEmptyBorder(4, 4, 4, 4))
	);
}
 
源代码19 项目: jdk8u60   文件: MemoryMonitor.java
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();
        }
    });
}
 
源代码20 项目: nextreports-designer   文件: BannerPanel.java
public BannerPanel() {
    setBorder(new CompoundBorder(new EtchedBorder(), new EmptyBorder(3, 3, 3, 3)));

    setOpaque(true);
    setBackground(UIManager.getColor("Table.background"));

    titleLabel = new JLabel();
    titleLabel.setOpaque(false);

    subtitleLabel = new JEditorPane("text/html", "<html>");
    subtitleLabel.setFont(titleLabel.getFont());

    LookAndFeelTweaks.makeBold(titleLabel);
    LookAndFeelTweaks.makeMultilineLabel(subtitleLabel);
    LookAndFeelTweaks.htmlize(subtitleLabel);

    iconLabel = new JLabel();
    iconLabel.setMinimumSize(new Dimension(50, 50));

    setLayout(new BorderLayout());

    JPanel nestedPane = new JPanel();
    nestedPane.setLayout(new GridBagLayout());
    nestedPane.setOpaque(false);
    nestedPane.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
            GridBagConstraints.WEST, GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5), 0, 0));
    nestedPane.add(new JLabel(""), new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0,
            GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
            new Insets(0, 0, 0, 0), 0, 0));        
    nestedPane.add(subtitleLabel, new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0,
            GridBagConstraints.WEST, GridBagConstraints.BOTH,
            new Insets(0, 5, 5, 5), 0, 0));

    add(BorderLayout.CENTER, nestedPane);
    add(BorderLayout.EAST, iconLabel);
}
 
源代码21 项目: JPPF   文件: PickList.java
/**
 * 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;
}
 
源代码22 项目: openjdk-jdk8u   文件: MemoryMonitor.java
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();
        }
    });
}
 
源代码23 项目: sldeditor   文件: MenuComboBox.java
/**
 * 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);
}
 
源代码24 项目: jdk8u-dev-jdk   文件: MemoryMonitor.java
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();
        }
    });
}
 
源代码25 项目: netbeans   文件: TemplateWizard1.java
/** 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);
}
 
源代码26 项目: netbeans   文件: NbTheme.java
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);
}
 
源代码27 项目: netbeans   文件: BorderBuilders.java
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);
}
 
源代码28 项目: GpsPrune   文件: DetailsDisplay.java
/**
 * 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;
}
 
源代码29 项目: mzmine2   文件: StatusBar.java
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();

  }
 
源代码30 项目: nextreports-designer   文件: MagicToggleButton.java
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);
    }
 
 类所在包
 类方法
 同包方法