Java 类javax.swing.border.EmptyBorder 实例源码

项目:avengers-db    文件:AvengersFrame.java   
/**
 * Create the frame.
 */
public AvengersFrame() throws Exception {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 1200, 800);
    heroPanel = new HeroInfo();
    heroPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    //heroPanel.setLayout(new BorderLayout(0, 0));
    setContentPane(heroPanel);
    HeroService service = new HeroService();
    heroPanel.addHero(service.findHeroesByName("Captain America"));
    heroPanel.getBtnSearch().addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            HeroInfo pan = new HeroInfo();
            pan.setBorder(new EmptyBorder(5, 5, 5, 5));
            setContentPane(pan);
            //pan.addHero(service.findHeroesByName(heroPanel.getTextField_1().toString()));
        }
    });
}
项目:QN-ACTR-Release    文件:AllStationsParametersPanel.java   
private void initComponents() {
    setLayout(new BorderLayout(5, 5));
    this.setBorder(new EmptyBorder(20, 20, 20, 20));
    //classesList = new JList(new StationsListModel());
    stationsList = new JList();
    stationsList.setListData(stationData.getStationKeys());
    stationsList.setCellRenderer(new StationElementRenderer());
    stationsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    panelDescription = new JLabel(STATIONS_PAR_DESCRIPTION);
    JScrollPane jsp = new JScrollPane(stationsList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jsp.setPreferredSize(new Dimension(140, 200));
    add(panelDescription, BorderLayout.NORTH);
    add(jsp, BorderLayout.WEST);
    stationsList.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            updateParsPane();
        }
    });
}
项目:Open-DM    文件:InitialImportFilePanel.java   
private void layoutGuiComponents() {

        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
        setBorder(new EmptyBorder(25, 25, 25, 25));

        importFileValue = new PlainFontLabel();
        JPanel labelPanel = new FixedHeightPanel();
        labelPanel.setLayout(new BoxLayout(labelPanel, BoxLayout.X_AXIS));
        labelPanel.add(new JLabel("File:"));
        labelPanel.add(Box.createHorizontalStrut(12));
        labelPanel.add(importFileValue);
        labelPanel.add(Box.createHorizontalGlue());

        displayArea = new JTextArea();
        displayArea.setEditable(false);
        displayArea.setForeground(Color.GRAY);
        JScrollPane scrollPane = new JScrollPane(displayArea);

        //
        // top level panel
        //
        add(labelPanel);
        add(Box.createVerticalStrut(17));
        add(scrollPane);
    }
项目:incubator-netbeans    文件:VariablesViewButtons.java   
private static JToggleButton createToggleButton (final String id, String iconPath, String tooltip) {
    Icon icon = ImageUtilities.loadImageIcon(iconPath, false);
    boolean isSelected = isButtonSelected(id);
    final JToggleButton toggleButton = new JToggleButton(icon, isSelected);
    // ensure small size, just for the icon
    Dimension size = new Dimension(icon.getIconWidth() + 8, icon.getIconHeight() + 8);
    toggleButton.setPreferredSize(size);
    toggleButton.setMargin(new Insets(1, 1, 1, 1));
    if (!"Aqua".equals(UIManager.getLookAndFeel().getID())) { //NOI18N
        // We do not want an ugly border with the exception of Mac, where it paints the toggle state!
        toggleButton.setBorder(new EmptyBorder(toggleButton.getBorder().getBorderInsets(toggleButton)));
    }
    toggleButton.setToolTipText(tooltip);
    toggleButton.setFocusable(false);
    return toggleButton;
}
项目:incubator-netbeans    文件:RuleEditorPanel.java   
private void setFilterVisible(boolean visible) {
    northWestPanel.removeAll();
    if(visible) {
        //update the UI
        northWestPanel.add(filterTextField, BorderLayout.CENTER);
        cancelFilterLabel.setBorder(new EmptyBorder(0,4,0,0));
        if(addPropertyMode) {
            northWestPanel.add(cancelFilterLabel, BorderLayout.WEST);
        }
        //set the filter text to the node
        node.setFilterText(filterTextField.getText());

        filterTextField.requestFocus();
    } else {
        //update the UI
        northWestPanel.add(titleLabel);

        //just remove the filter text from the node, but keep it in the field
        //so next time it is opened it will contain the old value
        node.setFilterText(null);
    }
    northWestPanel.revalidate();
    northWestPanel.repaint();
}
项目:JITRAX    文件:NewDatabaseDialog.java   
public NewDatabaseDialog() {
    newDatabaseNameField = new JTextField();
    nextButton = new JButton("NEXT");
    newDatabaseNameField.setPreferredSize(new Dimension(TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT));

    setLayout(new BorderLayout());

    EmptyBorder padding = new EmptyBorder(5, 5, 5, 5);
    JPanel textFieldPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
    JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));

    textFieldPanel.setBorder(padding);
    buttonsPanel.setBorder(padding);

    textFieldPanel.add(new JLabel("DB name: "));
    textFieldPanel.add(newDatabaseNameField);
    buttonsPanel.add(nextButton);

    add(textFieldPanel, BorderLayout.NORTH);
    add(buttonsPanel, BorderLayout.SOUTH);

    buildWindow();
}
项目:jmonet    文件:TextTool.java   
private void addTextArea(int x, int y) {
    int left = getCanvas().getBounds().x + x;
    int top = getCanvas().getBounds().y + y;

    textArea.setVisible(true);
    textArea.setBorder(new EmptyBorder(0, 0, 0, 0));
    textArea.setText("");
    textArea.setBounds(left, top, (int)(getCanvas().getBounds().getWidth() * getCanvas().getScale()) - left, (int)(getCanvas().getBounds().getHeight() * getCanvas().getScale()) - top);
    textArea.setFont(getScaledFont());
    textArea.addMouseListener(new MouseAdapter() {
        @Override
        public void mousePressed(MouseEvent e) {
            TextTool.this.mousePressed(e, new Point(0, 0));
        }
    });

    getCanvas().addComponent(textArea);
    textArea.requestFocus();
}
项目:incubator-netbeans    文件:RemoteRepository.java   
public static boolean updateFor (String url) {
    boolean retval = false;
    final RemoteRepository repository = new RemoteRepository(null, url, true);
    JPanel panel = repository.getPanel();
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));
    final DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(RemoteRepositoryPanel.class, "ACSD_RepositoryPanel_Title"), //NOI18N
            true, new Object[] { DialogDescriptor.OK_OPTION, DialogDescriptor.CANCEL_OPTION }, DialogDescriptor.OK_OPTION, 
            DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(RemoteRepository.class), null);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    repository.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged (ChangeEvent e) {
            dd.setValid(repository.isValid());
        }
    });
    if (repository.isValid()) {
        dd.setValid(true);
    }
    dialog.setVisible(true);
    if (dd.getValue() == DialogDescriptor.OK_OPTION) {
        repository.activeSettingsType.store();
        retval = true;
    }
    return retval;
}
项目:incubator-netbeans    文件:LibrariesCustomizer.java   
/**
 * Shows libraries customizer for given library manager.
 * @param activeLibrary if not null the activeLibrary is selected in the opened customizer
 * @return true if user pressed OK and libraries were sucessfully modified
 */
@Messages("TXT_LibrariesManager=Ant Library Manager")
public static boolean showCustomizer (Library activeLibrary, LibraryManager libraryManager) {
    org.netbeans.modules.project.libraries.ui.LibrariesCustomizer  customizer =
            new org.netbeans.modules.project.libraries.ui.LibrariesCustomizer (
                    LibrariesSupport.getLibraryStorageArea(libraryManager));
    customizer.setBorder(new EmptyBorder(12, 12, 0, 12));
    if (activeLibrary != null) {
        customizer.setSelectedLibrary (LibrariesSupport.getLibraryImplementation(activeLibrary));
    }
    DialogDescriptor descriptor = new DialogDescriptor(customizer, TXT_LibrariesManager());
    Dialog dlg = DialogDisplayer.getDefault().createDialog(descriptor);
    setAccessibleDescription(dlg, customizer.getAccessibleContext().getAccessibleDescription());
    try {
        dlg.setVisible(true);
        if (descriptor.getValue() == DialogDescriptor.OK_OPTION) {
            return customizer.apply();
        } else {
            return false;
        }
    } finally {
        dlg.dispose();
    }
}
项目:incubator-netbeans    文件:LibrariesCustomizer.java   
@Messages("LibrariesCustomizer.customizeLibrary.title=Customize Library")
private static boolean customizeLibrary(org.netbeans.modules.project.libraries.ui.LibrariesCustomizer customizer,
        LibraryImplementation activeLibrary) {
    customizer.hideLibrariesList();
    customizer.setBorder(new EmptyBorder(12, 8, 0, 10));
    customizer.setSelectedLibrary (activeLibrary);
    DialogDescriptor descriptor = new DialogDescriptor(customizer, LibrariesCustomizer_customizeLibrary_title());
    Dialog dlg = DialogDisplayer.getDefault().createDialog(descriptor);
    setAccessibleDescription(dlg, customizer.getAccessibleContext().getAccessibleDescription());
    try {
        dlg.setVisible(true);
        if (descriptor.getValue() == DialogDescriptor.OK_OPTION) {
            customizer.apply();
            return true;
        } else {
            return false;
        }
    } finally {
        dlg.dispose();
    }
}
项目:Open-DM    文件:GUIHelper.java   
private static JScrollPane getMessageScrollPane(String message) {
    JTextArea ta = new JTextArea(message);
    ta.setBorder(new EmptyBorder(0, 0, 0, 0));
    ta.setLineWrap(true);
    ta.setWrapStyleWord(true);
    ta.setCaretPosition(0);
    ta.setEditable(false);
    JScrollPane sp = new JScrollPane(ta);
    sp.setBorder(new EmptyBorder(5, 5, 5, 5));
    if (message.length() < 100) {
        sp.setPreferredSize(new Dimension(400, 50));
    } else {
        sp.setPreferredSize(new Dimension(400, 100));
    }
    return sp;
}
项目:incubator-netbeans    文件:BrowserDisplayer.java   
/**
 * Creates a link label. A link label is a form of a JButton but without a
 * button like appearance.
 */
private void createLinkLabel() {
    setBorder(new EmptyBorder(1,1,1,1));
    setBorderPainted(false);
    setFocusPainted(false);
    setAlignmentY(getPreferredAlignmentY());
    setContentAreaFilled(false);
    setHorizontalAlignment(SwingConstants.LEFT);
    setBackground(UIManager.getColor("EditorPane.background"));
    if (textAttribs != null &&
        textAttribs.isDefined(StyleConstants.Foreground)) {
        setForeground((Color)textAttribs.getAttribute(StyleConstants.Foreground));
    } else {
        setForeground(Color.blue);
    }
    invalidate();
}
项目:BassNES    文件:About.java   
/**
 * Create the frame.
 */
public About() {
    setTitle("About - BassNES");
    setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    setBounds(100, 100, 290, 228);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);

    JLabel lblNewLabel = new JLabel("BassNES");
    lblNewLabel.setFont(new Font("Times New Roman", Font.BOLD, 24));
    lblNewLabel.setBounds(25, 11, 128, 43);
    contentPane.add(lblNewLabel);

    JLabel lblNewLabel_1 = new JLabel("Version: "+ UISettings.version);
    lblNewLabel_1.setBounds(25, 51, 115, 14);
    contentPane.add(lblNewLabel_1);

    JLabel lblNewLabel_2 = new JLabel("�2017 J. Howe (aka TheBassist95)");
    lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 14));
    lblNewLabel_2.setBounds(10, 65, 254, 23);
    contentPane.add(lblNewLabel_2);
}
项目:incubator-netbeans    文件:DirectoryChooserUI.java   
@Override
public void installComponents(JFileChooser fc) {
    fileChooser = fc;

    fc.setFocusCycleRoot(true);
    fc.setBorder(new EmptyBorder(4, 10, 10, 10));
    fc.setLayout(new BorderLayout(8, 8));

    updateUseShellFolder();
    createCenterPanel(fc);
    fc.add(centerPanel, BorderLayout.CENTER);

    if (fc.isMultiSelectionEnabled()) {
        setFileName(getStringOfFileNames(fc.getSelectedFiles()));
    } else {
        setFileName(getStringOfFileName(fc.getSelectedFile()));
    }

    if(fc.getControlButtonsAreShown()) {
        addControlButtons();
    }

    createPopup();

    initUpdateWorker();
}
项目:TransparentDiscord    文件:UITitleBar.java   
/**
 * Creates a title bar with the given text and ability to close the parent jframe
 * @param titleText the text to display as the title, can be HTML formatted
 * @param parent the jframe to close when the X is clicked
 */
public UITitleBar(String titleText, JFrame parent) {
    setBackground(Color.decode("#7289DA"));
    setLayout(new BorderLayout());

    JLabel title = new JLabel(titleText);
    title.setFont(TransparentDiscord.boldFont.deriveFont(Font.PLAIN, 16));
    title.setBorder(new EmptyBorder(20,20,20,20));
    add(title, BorderLayout.WEST);

    JLabel closeButton = new JLabel("X");
    closeButton.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent mouseEvent) {
            parent.setVisible(false);
        }
    });
    closeButton.setBorder(new EmptyBorder(20,20,20,20));
    closeButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
    add(closeButton, BorderLayout.EAST);
}
项目:incubator-netbeans    文件:OptionsPanel.java   
void setSelected () {
    if (isMac) {
        setBorder(new CompoundBorder (
                new VariableBorder(null, selectedB, null, selectedB),
                BorderFactory.createEmptyBorder(5, 5, 3, 5)
                ));
    } else {
        setBorder (new CompoundBorder (
            new CompoundBorder (
                new LineBorder (getTabPanelBackground()),
                new LineBorder (selectedB)
            ),
            new EmptyBorder (0, 2, 0, 2)
        ));
    }
    setBackground (selected);            
}
项目:incubator-netbeans    文件:VariablesViewButtons.java   
private static JToggleButton createToggleButton (final String id, String iconName, String tooltip) {
    Icon icon = loadIcon(iconName);
    boolean isSelected = isButtonSelected(id);
    final JToggleButton toggleButton = new JToggleButton(icon, isSelected);
    // ensure small size, just for the icon
    Dimension size = new Dimension(icon.getIconWidth() + 8, icon.getIconHeight() + 8);
    toggleButton.setPreferredSize(size);
    toggleButton.setMargin(new Insets(1, 1, 1, 1));
    if (!"Aqua".equals(UIManager.getLookAndFeel().getID())) { //NOI18N
        // We do not want an ugly border with the exception of Mac, where it paints the toggle state!
        toggleButton.setBorder(new EmptyBorder(toggleButton.getBorder().getBorderInsets(toggleButton)));
    }
    toggleButton.setToolTipText(tooltip);
    toggleButton.setFocusable(false);
    return toggleButton;
}
项目:DicomViewer    文件:FlyingToolTip.java   
public FlyingToolTip(final FlyingToolTipListener source) {
    this.source = source;
    label = new JLabel("test", JLabel.CENTER) {
        @Override
        public void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D) g.create();
            int w = getWidth(), h = getHeight();
            g.setColor(getBackground());
            g.fillRect(0,0,w,h);

            if (path != null) {                    
                g2.setStroke(new BasicStroke(4f));
                g2.setColor(getForeground());
                g2.draw(path);
            }
            setOpaque(false);
            super.paintComponent(g2);
            setOpaque(true);
            g2.dispose();
        }
    };    
    label.setBorder(new EmptyBorder(2,4,10,4));
    label.setOpaque(true);
}
项目:incubator-netbeans    文件:InfoPanel.java   
Item(Color backgroundColor, int preferredHeight, JComponent innerPanel) {
    this.backgroundColor = backgroundColor;
    this.preferredHeight = preferredHeight;
    this.innerPanel = innerPanel;
    topGapPanel = createGapPanel();
    bottomGapPanel = createGapPanel();
    separator = createSeparator();
    outerPanel = new JPanel();
    outerPanel.setBackground(backgroundColor);
    outerPanel.setLayout(new BorderLayout());
    outerPanel.add(BorderLayout.NORTH, topGapPanel);
    outerPanel.add(BorderLayout.CENTER, innerPanel);
    outerPanel.add(BorderLayout.SOUTH, bottomGapPanel);
    outerPanel.setPreferredSize(new Dimension(0, preferredHeight));
    scrollPane = new JScrollPane();
    scrollPane.setBorder(new EmptyBorder(0, 0, 0, 0));
    scrollPane.setPreferredSize(new Dimension(0, preferredHeight));
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setViewportView(outerPanel);
}
项目:TransparentDiscord    文件:UIChat.java   
private void addAttachmentPreview(Image image) {
    ImageIcon preview = TransparentDiscord.resizeToWidth(new ImageIcon(image), TransparentDiscord.getChatWidth()-10);
    JLabel previewLabel = new JLabel(preview);
    previewLabel.setBorder(new EmptyBorder(5,5,5,5));
    previewLabel.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent mouseEvent) {
            BorderLayout layout = (BorderLayout) messageCompose.getLayout();
            messageCompose.remove(layout.getLayoutComponent(BorderLayout.CENTER));

            attachment = null;
            fileAttachment = null;

            refresh();
        }
    });
    previewLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
    messageCompose.add(previewLabel,BorderLayout.CENTER);
    refresh();
}
项目:VASSAL-src    文件:WizardDisplayerImpl.java   
void handleSummary(Summary summary)
{
    inSummary = true;
    JComponent summaryComp = (JComponent) summary.getSummaryComponent(); // XXX
    if (summaryComp.getBorder() != null)
    {
        CompoundBorder b = new CompoundBorder(new EmptyBorder(5, 5, 5, 5), summaryComp
            .getBorder());
        summaryComp.setBorder(b);
    }
    setCurrentWizardPanel(summaryComp); // XXX
    instructions.setInSummaryPage(true);
    ttlLabel.setText(NbBridge.getString("org/netbeans/api/wizard/Bundle", // NOI18N
                                        WizardDisplayerImpl.class, "Summary")); // NOI18N
    getButtonManager().setSummaryShowingMode();
    summaryComp.requestFocus();

}
项目:AquamarineLake    文件:MyFrame.java   
/**
* Create the frame.
*/
  public MyFrame() {
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setBounds(100, 100, 650, 490);
      contentPane = new JPanel();
      contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
      setContentPane(contentPane);
      contentPane.setLayout(null);

      new MyThread().start();
  }
项目:Library-app    文件:Busqueda.java   
public Busqueda(Connection conn, JFrameJTable principal, String sql, char QuienEs) {
    setIconImage(Toolkit.getDefaultToolkit().getImage(Busqueda.class.getResource("/biblioteca/images/book.png")));
    this.QuienEs=QuienEs;
    this.conn=conn;
    this.principal=principal;
    this.principal.setEnabled(false);
    setTitle("B�squeda");

    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setBounds(100, 100, 492, 370);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);

    txtUsuario = new JTextField();
    txtUsuario.setBounds(10, 33, 328, 23);
    contentPane.add(txtUsuario);
    txtUsuario.setColumns(10);
    txtUsuario.addKeyListener(this);

    btnBuscar = new JButton("Buscar");
    btnBuscar.setBounds(357, 32, 109, 23);
    contentPane.add(btnBuscar);
    btnBuscar.addActionListener(this);

    table = new PanelJtable(conn,sql,this);
    table.setBounds(10, 78, 456, 242);
    contentPane.add(table);

    addWindowListener(this);
    setVisible(true);
    setLocationRelativeTo(null);
}
项目:alevin-svn2    文件:MultiAlgoScenarioWizard.java   
@Override
protected JPanel createContent() {
    JPanel content = new JPanel();
    content.setBorder(new EmptyBorder(PADDING, PADDING, 0, PADDING));
    content.setLayout(new BorderLayout(PADDING, 0));

    // createTable enables/disables buttons, therefore createButtons must be called first
    content.add(this.createButtons(), BorderLayout.EAST);
    content.add(this.createTable(), BorderLayout.CENTER);

    return content;
}
项目:featurea    文件:SimulationTreePanel.java   
/**
 * Default constructor.
 */
public SimulationTreePanel() {
    this.root = new DefaultMutableTreeNode(null, true);
    this.model = new DefaultTreeModel(this.root);
    this.tree = new JTree(this.model);
    this.tree.setCellRenderer(new Renderer());
    this.tree.setEditable(false);
    this.tree.setShowsRootHandles(true);
    this.tree.setBorder(new EmptyBorder(5, 0, 0, 0));

    // the bounds
    this.bounds = new DefaultMutableTreeNode(new NullBounds());
    this.model.insertNodeInto(this.bounds, this.root, this.root.getChildCount());
    this.tree.expandPath(new TreePath(this.bounds).getParentPath());

    // folder to contain the bodies
    this.bodyFolder = new DefaultMutableTreeNode(Messages.getString("panel.tree.bodyFolder"));
    this.model.insertNodeInto(this.bodyFolder, this.root, this.root.getChildCount());
    this.tree.expandPath(new TreePath(this.bodyFolder.getPath()).getParentPath());

    // folder to contain the joints
    this.jointFolder = new DefaultMutableTreeNode(Messages.getString("panel.tree.jointFolder"));
    this.model.insertNodeInto(this.jointFolder, this.root, this.root.getChildCount());
    this.tree.expandPath(new TreePath(this.jointFolder.getPath()).getParentPath());

    // folder to contain the rays
    this.rayFolder = new DefaultMutableTreeNode(Messages.getString("panel.tree.rayFolder"));
    this.model.insertNodeInto(this.rayFolder, this.root, this.root.getChildCount());
    this.tree.expandPath(new TreePath(this.rayFolder.getPath()).getParentPath());

    this.scroller = new JScrollPane(this.tree);
    this.scroller.setBorder(BorderFactory.createLineBorder(Color.GRAY));

    this.setLayout(new BorderLayout());
    this.add(this.scroller);

    this.tree.addMouseListener(this);

    this.createContextMenus();
}
项目:java-irc    文件:Channel.java   
/**
 * Create the frame to choose the channel
 */
public Channel() {
    this.setTitle("Chat IRC");
    this.setResizable(false);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setBounds(100, 100, 460, 261);
    this.setLocationRelativeTo(null);
    setIconImage(Toolkit.getDefaultToolkit().getImage(Channel.class.getResource("/image/swag.png")));
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);

    JButton btnOk = new JButton("OK");
    Icon imgOk = new ImageIcon(Toolkit.getDefaultToolkit().getImage(Channel.class.getResource("/image/ok.png")));
    btnOk.setIcon(imgOk);
    btnOk.setFont(new Font("Tahoma", Font.BOLD, 14));
    btnOk.addActionListener(new ChannelListener());
    btnOk.setBounds(164, 152, 104, 30);
    contentPane.add(btnOk);

    JLabel lblChannel = new JLabel("Channel");
    lblChannel.setHorizontalAlignment(SwingConstants.LEFT);
    lblChannel.setFont(new Font("Tahoma", Font.BOLD, 14));
    lblChannel.setBounds(187, 30, 72, 30);
    contentPane.add(lblChannel);

    textFieldChannel = new JTextField();
    textFieldChannel.setFont(new Font("Tahoma", Font.PLAIN, 14));
    textFieldChannel.setBounds(115, 85, 203, 30);
    contentPane.add(textFieldChannel);
    textFieldChannel.setColumns(10);

    this.addWindowListener( new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            closeFrame();
        }
    });
}
项目:incubator-netbeans    文件:BasicSearchForm.java   
/**
 * Initialize panel for controls for text pattern options and add it to the
 * form panel.
 */
private void initContainingTextOptionsRow(boolean searchAndReplace) {

    JPanel jp = new JPanel();
    JPanel typeWithLabelPanel = new JPanel();
    typeWithLabelPanel.setLayout(new BoxLayout(typeWithLabelPanel,
            BoxLayout.LINE_AXIS));
    JLabel typeLabel = new JLabel();
    typeLabel.setLabelFor(textToFindType);
    lclz(typeLabel, "BasicSearchForm.textToFindType.label.text");   //NOI18N
    typeLabel.setBorder(new EmptyBorder(0, 10, 0, 5));
    typeWithLabelPanel.add(typeLabel);
    typeWithLabelPanel.add(textToFindType);
    if (searchAndReplace) {
        FormLayoutHelper flh = new FormLayoutHelper(jp,
                FormLayoutHelper.DEFAULT_COLUMN,
                FormLayoutHelper.DEFAULT_COLUMN);
        flh.addRow(chkCaseSensitive, chkPreserveCase);
        flh.addRow(chkWholeWords, typeWithLabelPanel);
        jp.setMaximumSize(jp.getMinimumSize());

        formPanel.addRow(new JLabel(), jp);
    } else {
        jp.setLayout(new BoxLayout(jp, BoxLayout.LINE_AXIS));
        jp.add(chkCaseSensitive);
        jp.add(chkWholeWords);
        jp.add(typeWithLabelPanel);
        formPanel.addRow(new JLabel(), jp);
    }
}
项目:Tarski    文件:OurTree.java   
/** Constructs this renderer. */
public OurTreeRenderer(int fontSize) {
   super("Anything"); // This ensures that the height is calculated properly
   setFont(OurUtil.getVizFont().deriveFont((float)fontSize));
   setVerticalAlignment(JLabel.BOTTOM);
   setBorder(new EmptyBorder(0, 3, 0, 3));
   setText("Anything"); // So that we can derive the height
   height = super.getPreferredSize().height;
}
项目:Equella    文件:JFlatDialog.java   
public Title(String text)
{
    setBorder(new EmptyBorder(0, 8, 0, 0));
    setOpaque(false);
    setText(text);
    setBackground(Color.BLACK);
}
项目:xdman    文件:ConfigDialog.java   
Box createConnectionPanel() {
    Box box = Box.createVerticalBox();
    box.setOpaque(false);
    box.setBorder(new EmptyBorder(10, 0, 0, 10));

    Box box2 = Box.createHorizontalBox();
    box2.add(new JLabel(getString("DWN_TYM")));
    box2.add(Box.createHorizontalGlue());
    cmbTimeout = new JComboBox(new String[] { "10", "15", "20", "30", "45",
            "60", "120", "180", "240", "300" });
    cmbTimeout.setMaximumSize(cmbTimeout.getPreferredSize());
    box2.add(cmbTimeout);
    box.add(box2);
    box2.setBorder(new EmptyBorder(2, 0, 2, 0));

    Box box1 = Box.createHorizontalBox();
    box1.add(new JLabel(getString("DWN_SEG")));
    box1.add(Box.createHorizontalGlue());
    cmbConn = new JComboBox(new String[] { "1", "2", "3", "4", "5", "6",
            "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "20",
            "24", "26", "28", "30", "32" });
    cmbConn.setMaximumSize(cmbTimeout.getPreferredSize());
    cmbConn.setPreferredSize(cmbTimeout.getPreferredSize());
    box1.add(cmbConn);
    box.add(box1);
    box1.setBorder(new EmptyBorder(2, 0, 2, 0));

    Box box3 = Box.createHorizontalBox();
    box3.add(new JLabel(getString("DWN_TCP")));
    box3.add(Box.createHorizontalGlue());
    cmbTcpW = new JComboBox(new String[] { "8", "16", "32", "64" });
    cmbTcpW.setMaximumSize(cmbTimeout.getPreferredSize());
    cmbTcpW.setPreferredSize(cmbTimeout.getPreferredSize());
    box3.add(cmbTcpW);
    box.add(box3);
    box3.setBorder(new EmptyBorder(2, 0, 2, 0));

    box.add(Box.createVerticalGlue());
    return box;
}
项目:TwitchBot    文件:MainView.java   
private void managePanels() {
    this.logPanel = new JPanel();
    this.interactionPanel = new JPanel();
    this.logPanel.setPreferredSize(new Dimension(this.essentials.getFrameSize().width / 2, this.essentials.getFrameSize().height));

    this.mainRightPanel = new JPanel();
    this.rightPanel2 = new JPanel();
    this.rightPanel3 = new JPanel();
    this.rightPanel4 = new JPanel();
    this.rightPanel5 = new JPanel();
    this.rightPanel6 = new JPanel();

    this.logPanel.setLayout(new BorderLayout());
    this.logPanel.setBorder(new EmptyBorder(10, 30, 30, 30));

    this.interactionPanel.setLayout(new BorderLayout());
    this.interactionPanel.setBorder(new EmptyBorder(10, 0, 30, 30));

    this.mainRightPanel.setLayout(new BoxLayout(this.mainRightPanel, BoxLayout.Y_AXIS));
    this.mainRightPanel.setBorder(new EmptyBorder(10, 10, 10, 10));

    // rightPanel2.setBackground(Color.green);
    this.rightPanel2.setBorder(new EmptyBorder(50, 0, -90, 0));

    // rightPanel3.setBackground(Color.ORANGE);
    this.rightPanel3.setBorder(new EmptyBorder(0, 0, -140, 0));

    // rightPanel4.setBackground(Color.yellow);
    this.rightPanel4.setBorder(new EmptyBorder(50, 0, -90, 0));

    // rightPanel5.setBackground(Color.CYAN);

    // rightPanel6.setBackground(Color.black);
}
项目:JITRAX    文件:SelectedDatabaseViewer.java   
public SelectedDatabaseViewer() {
    dbComboBox = new JComboBox<Database>();
    alterButton = new JButton("ALTER");
    removeButton = new JButton("DROP");

    setLayout(new GridLayout(NROWS, NCOLS, VGAP, HGAP));
    setBorder(new EmptyBorder(TOP_PADDING,
                            LEFT_PADDING,
                            BOTTOM_PADDING,
                            RIGHT_PADDING));

    // ComboBox settings
    dbComboBox.setPreferredSize(new Dimension(COMBOBOX_WIDTH, COMBOBOX_HEIGHT));
    DefaultListCellRenderer dlcr = new DefaultListCellRenderer(); 
    dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER); 
    dbComboBox.setRenderer(dlcr);
    dbComboBox.setFocusable(false);

    JPanel comboBoxContainer = new JPanel();
    comboBoxContainer.add(dbComboBox);

    JPanel buttonsPanel = new JPanel();
    buttonsPanel.add(alterButton);
    buttonsPanel.add(removeButton);

    add(comboBoxContainer);
    add(buttonsPanel);

    setMinimumSize(new Dimension(MINIMUM_WIDTH, MINIMUM_HEIGHT));
    setMaximumSize(new Dimension(MAXIMUM_WIDTH, MAXIMUM_HEIGHT));
}
项目:GameOfSet    文件:InfoPanel.java   
private JLabel createSetsCountLabel() {
    JLabel label = new JLabel("Sets found: 0.");
    label.setOpaque(true);
    label.setBackground(Color.gray);
    label.setBorder(new EmptyBorder(10, 10, 10, 10));
    return label;
}
项目:KSP-AGuS-Automatic-Guidance-System    文件:GUI_CONSOLE.java   
/**
 * Create the frame.
 */
public GUI_CONSOLE(String name) {
    super(name);
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setBounds(100, 100, 450, 300);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    contentPane.setLayout(new BorderLayout(0, 0));
    setContentPane(contentPane);
    setup();
}
项目:incubator-netbeans    文件:NbiTextPane.java   
public NbiTextPane() {
    super();

    setOpaque(false);
    setEditable(false);
    setBorder(new EmptyBorder(0, 0, 0, 0));
    setFocusable(false);
    putClientProperty(JTextPane.HONOR_DISPLAY_PROPERTIES, true);

    if (UIManager.getLookAndFeel().getID().equals("Nimbus")) {
        //#134837
        //http://forums.java.net/jive/thread.jspa?messageID=283882
        setBackground(new Color(0, 0, 0, 0));
    }
}
项目:owa-notifier    文件:BorderLayoutNotification.java   
public BorderLayoutNotification() {
    super();

    m_panel = new JPanel(new BorderLayout());
    m_panel.setBorder(new EmptyBorder(PANEL_PADDING, PANEL_PADDING, PANEL_PADDING, PANEL_PADDING));
    setPanel(m_panel);
}
项目:etomica    文件:ClusterViewer.java   
private ClusterViewer(String name) {

    this.name = name;
    setTitle("Cluster Viewer: $" + name);
    setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    mainPanel = new JPanel();
    mainPanel.setPreferredSize(new Dimension(800, 600));
    mainPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
    mainPanel.setLayout(new BorderLayout(0, 0));
    add(mainPanel);
    pack();
  }
项目:JavaGraph    文件:ProgressBarDialog.java   
private Box getPanel() {
    Box result = Box.createVerticalBox();
    result.setBorder(new EmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH));
    result.add(getLabel());
    result.add(Box.createVerticalGlue());
    result.add(getBar());
    result.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT));
    return result;
}
项目:QN-ACTR-Release    文件:AllBlockingRegionsPanel.java   
/**
 * Initialize all components of this panel
 */
private void initComponents() {
    setLayout(new BorderLayout(5, 5));
    this.setBorder(new EmptyBorder(20, 20, 20, 20));
    // Builds upper panel
    JPanel upperPanel = new JPanel(new BorderLayout());
    JLabel description = new JLabel(BLOCKING_DESCRIPTION);
    upperPanel.add(description, BorderLayout.CENTER);

    //build upper right corner of the main panel
    JPanel upRightPanel = new JPanel(new BorderLayout());
    addRegion = new JButton("Add Region");
    addRegion.setMinimumSize(DIM_BUTTON_S);
    upRightPanel.add(addRegion, BorderLayout.CENTER);
    upperPanel.add(upRightPanel, BorderLayout.EAST);

    //build spinner panel
    JPanel spinnerPanel = new JPanel();
    JLabel spinnerDescrLabel = new JLabel("Regions:");
    regionsNumSpinner = new JSpinner();
    regionsNumSpinner.setPreferredSize(DIM_BUTTON_XS);
    spinnerPanel.add(spinnerDescrLabel);
    spinnerPanel.add(regionsNumSpinner);
    upRightPanel.add(spinnerPanel, BorderLayout.SOUTH);

    add(upperPanel, BorderLayout.NORTH);

    // Creates blocking regions list
    regions = new RegionTable();
    regions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    JScrollPane jsp = new JScrollPane(regions, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jsp.setPreferredSize(new Dimension(220, 200));
    add(jsp, BorderLayout.WEST);
    update();
}
项目:incubator-netbeans    文件:ParametersPanel.java   
private static ProgressBar create(ProgressHandle handle) {
    ProgressBar instance = new ProgressBar();
    instance.setLayout(new BorderLayout());
    instance.label = new JLabel(" "); //NOI18N
    instance.label.setBorder(new EmptyBorder(0, 0, 2, 0));
    instance.add(instance.label, BorderLayout.NORTH);
    JComponent progress = ProgressHandleFactory.createProgressComponent(handle);
    instance.add(progress, BorderLayout.CENTER);
    return instance;
}