當前位置: 首頁>>代碼示例>>Java>>正文


Java EmptyBorder類代碼示例

本文整理匯總了Java中javax.swing.border.EmptyBorder的典型用法代碼示例。如果您正苦於以下問題:Java EmptyBorder類的具體用法?Java EmptyBorder怎麽用?Java EmptyBorder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EmptyBorder類屬於javax.swing.border包,在下文中一共展示了EmptyBorder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: AvengersFrame

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
/**
 * 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()));
		}
	});
}
 
開發者ID:Bartac,項目名稱:avengers-db,代碼行數:23,代碼來源:AvengersFrame.java

示例2: Busqueda

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
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);
}
 
開發者ID:JuandeLS3,項目名稱:Library-app,代碼行數:35,代碼來源:Busqueda.java

示例3: initComponents

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
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();
		}
	});
}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:21,代碼來源:AllStationsParametersPanel.java

示例4: layoutGuiComponents

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
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);
    }
 
開發者ID:Hitachi-Data-Systems,項目名稱:Open-DM,代碼行數:26,代碼來源:InitialImportFilePanel.java

示例5: createToggleButton

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:VariablesViewButtons.java

示例6: jbInit

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
void jbInit() throws Exception {
	border1 =
			BorderFactory.createCompoundBorder(
					BorderFactory.createEtchedBorder(
							Color.white,
							new Color(156, 156, 158)),
							BorderFactory.createEmptyBorder(5, 5, 5, 5));
	border2 = BorderFactory.createEmptyBorder(5, 0, 5, 0);
	panel1.setLayout(borderLayout1);
	this.getContentPane().setLayout(borderLayout2);

	bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
	topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
	topPanel.setBorder(new EmptyBorder(new Insets(0, 5, 0, 5)));
	topPanel.setBackground(Color.WHITE);

	jPanel1.setLayout(borderLayout3);
	panel1.setBorder(border1);
	jPanel1.setBorder(border2);

	getContentPane().add(panel1, BorderLayout.CENTER);
	panel1.add(jScrollPane1, BorderLayout.CENTER);
	jScrollPane1.getViewport().add(stickerText, null);
	panel1.add(jPanel1, BorderLayout.SOUTH);
	this.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
	this.getContentPane().add(topPanel, BorderLayout.NORTH);

	stickerText.setText(txt);
	stickerText.setOpaque(true);
	stickerText.setBackground(backGroundColor);
	stickerText.setForeground(foreGroundColor);
}
 
開發者ID:ser316asu,項目名稱:SER316-Munich,代碼行數:33,代碼來源:StickerExpand.java

示例7: setFilterVisible

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:RuleEditorPanel.java

示例8: NewDatabaseDialog

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
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();
}
 
開發者ID:tteguayco,項目名稱:JITRAX,代碼行數:24,代碼來源:NewDatabaseDialog.java

示例9: addTextArea

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
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();
}
 
開發者ID:defano,項目名稱:jmonet,代碼行數:20,代碼來源:TextTool.java

示例10: updateFor

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:26,代碼來源:RemoteRepository.java

示例11: showCustomizer

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
/**
 * 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();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:29,代碼來源:LibrariesCustomizer.java

示例12: customizeLibrary

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
@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();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:LibrariesCustomizer.java

示例13: getMessageScrollPane

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
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;
}
 
開發者ID:Hitachi-Data-Systems,項目名稱:Open-DM,代碼行數:17,代碼來源:GUIHelper.java

示例14: createLinkLabel

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
/**
 * 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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:BrowserDisplayer.java

示例15: About

import javax.swing.border.EmptyBorder; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:QuantumSoundings,項目名稱:BassNES,代碼行數:27,代碼來源:About.java


注:本文中的javax.swing.border.EmptyBorder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。