当前位置: 首页>>代码示例>>Java>>正文


Java JButton.setBorderPainted方法代码示例

本文整理汇总了Java中javax.swing.JButton.setBorderPainted方法的典型用法代码示例。如果您正苦于以下问题:Java JButton.setBorderPainted方法的具体用法?Java JButton.setBorderPainted怎么用?Java JButton.setBorderPainted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JButton的用法示例。


在下文中一共展示了JButton.setBorderPainted方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDetails

import javax.swing.JButton; //导入方法依赖的package包/类
private JComponent createDetails(String text, ActionListener action) {
    try {
        text = (action == null ? "<html>" : "<html><a href=\"_blank\">") + XMLUtil.toElementContent(text); //NOI18N
    } catch (CharConversionException ex) {
        throw new IllegalArgumentException(ex);
    }
    if (null == action) {
        return new JLabel(text);
    }
    JButton btn = new JButton(text);
    btn.setFocusable(false);
    btn.setBorder(BorderFactory.createEmptyBorder());
    btn.setBorderPainted(false);
    btn.setFocusPainted(false);
    btn.setOpaque(false);
    btn.setContentAreaFilled(false);
    btn.addActionListener(action);
    btn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    Color c = UIManager.getColor("nb.html.link.foreground"); //NOI18N
    if (c != null) {
        btn.setForeground(c);
    }
    return btn;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:NotificationImpl.java

示例2: setupButton

import javax.swing.JButton; //导入方法依赖的package包/类
private void setupButton(JButton button)
{
	applyFlatterLaF(button);

	button.setBorderPainted(false);
	button.setIconTextGap(10);
	button.addActionListener(this);
}
 
开发者ID:equella,项目名称:Equella,代码行数:9,代码来源:ManagementDialog.java

示例3: getToolbarPresenter

import javax.swing.JButton; //导入方法依赖的package包/类
public static Component getToolbarPresenter(Action action) {
    JButton button = new JButton(action);
    button.setBorderPainted(false);
    button.setOpaque(false);
    button.setText(null);
    button.putClientProperty("hideActionText", Boolean.TRUE); // NOI18N
    Object icon = action.getValue(Action.SMALL_ICON);
    if (icon == null) {
        icon = ImageUtilities.loadImageIcon("org/netbeans/modules/dlight/terminal/action/local_term.png", false);// NOI18N
    }
    if (!(icon instanceof Icon)) {
        throw new IllegalStateException("No icon provided for " + action); // NOI18N
    }
    button.setDisabledIcon(ImageUtilities.createDisabledIcon((Icon) icon));
    return button;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:TerminalSupportImpl.java

示例4: getDetailsPanel

import javax.swing.JButton; //导入方法依赖的package包/类
private static JComponent getDetailsPanel(String summary) {
    JPanel details = new JPanel(new GridBagLayout());
    details.setOpaque(false);
    JLabel lblMessage = new JLabel(summary);
    
    JButton reportLink = new JButton("<html><a href=\"_blank\">" + NbBundle.getMessage(NotifyExcPanel.class, "NTF_ExceptionalExceptionReport")); //NOI18N
    reportLink.setFocusable(false);
    reportLink.setBorder(BorderFactory.createEmptyBorder());
    reportLink.setBorderPainted(false);
    reportLink.setFocusPainted(false);
    reportLink.setOpaque(false);
    reportLink.setContentAreaFilled(false);
    reportLink.addActionListener(flash);
    reportLink.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

    details.add(reportLink, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(3, 0, 3, 0), 0, 0));
    details.add(lblMessage, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(3, 0, 3, 0), 0, 0));
    return details;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:NotifyExcPanel.java

示例5: init

import javax.swing.JButton; //导入方法依赖的package包/类
void init(){
	panel=new JPanel();
	panel.setLayout(new MigLayout("insets 0 5 0 0","[grow,fill]rel[right]", "[]0[]"));
	panel.setOpaque(true);
	panel.setBackground(color_normal);
	addressLabel=new JLabel("");
	panel.add(addressLabel,"");
	addressLabel.setOpaque(false);
	
	button_remove=new JButton("x");
	//panel.add(button_remove,"align right");
	button_remove.setOpaque(false);
	button_remove.setContentAreaFilled(false);
	button_remove.setBorderPainted(false);
	button_remove.setMargin(new Insets(0, 10, 0, 10));
	button_remove.addActionListener(new ActionListener() {
		
		@Override
		public void actionPerformed(ActionEvent e) {
			System.out.println(e);
		}
	});

}
 
开发者ID:jonasxiao,项目名称:FinalSpeed,代码行数:25,代码来源:AddressCellRenderer.java

示例6: createConfigureButton

import javax.swing.JButton; //导入方法依赖的package包/类
private JComponent createConfigureButton() {
    if( null == browserProvider || !browserProvider.hasCustomizer() )
        return null;
    JButton button = new JButton(NbBundle.getMessage(BrowserMenu.class, "Ctl_ConfigurePhoneGap"));
    button.addActionListener( new ActionListener() {

        @Override
        public void actionPerformed( ActionEvent e ) {
            browserProvider.customize();
        }
    });
    button.setBorder( new EmptyBorder(1, 1, 1, 1) );
    button.setMargin( new Insets(0, 0, 0, 0) );

    button.setCursor( Cursor.getPredefinedCursor(Cursor.HAND_CURSOR) );
    button.setHorizontalAlignment( JLabel.LEFT );
    button.setFocusable( false );

    button.setBorderPainted( false );
    button.setFocusPainted( false );
    button.setRolloverEnabled( true );
    button.setContentAreaFilled( false );

    return button;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:BrowserMenu.java

示例7: createButtons

import javax.swing.JButton; //导入方法依赖的package包/类
void createButtons() {
    for (int i = 0; i < chars.length; i++) {
        JButton button = new JButton(new CharAction(chars[i]));
        button.setMaximumSize(new Dimension(50, 22));
        //button.setMinimumSize(new Dimension(22, 22));
        button.setPreferredSize(new Dimension(30, 22));
        button.setRequestFocusEnabled(false);
        button.setFocusable(false);
        button.setBorderPainted(false);
        button.setOpaque(false);
        button.setMargin(new Insets(0,0,0,0));
        button.setFont(new Font("serif", 0, 14));
        if (i == chars.length-1) {
            button.setText("nbsp");
            button.setFont(new Font("Dialog",0,10));
            button.setMargin(new Insets(0,0,0,0));
        }
        this.add(button, null);
    }
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:21,代码来源:CharTablePanel.java

示例8: setLinkLikeButton

import javax.swing.JButton; //导入方法依赖的package包/类
/**
 * Set button border and background to look like a label with link.
 */
private void setLinkLikeButton(JButton button) {
    button.setBorderPainted(false);
    button.setContentAreaFilled(false);
    button.setBorder(new EmptyBorder(0, 0, 0, 0));
    button.setCursor(Cursor.getPredefinedCursor(
            Cursor.HAND_CURSOR));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:LinkButtonPanel.java

示例9: ColorCellEditor

import javax.swing.JButton; //导入方法依赖的package包/类
/**
 * Creates a new ColorCellEditor. This object will act as a Renderer or Editor.
 */
public ColorCellEditor() {
	button = new JButton();
	button.setActionCommand(EDIT);
	button.addActionListener(this);
	button.setBorderPainted(false);
	label.setOpaque(true);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:11,代码来源:ColorCellEditor.java

示例10: TableCellEditor4Color

import javax.swing.JButton; //导入方法依赖的package包/类
/**
 * Instantiates a new color editor.
 */
public TableCellEditor4Color() {
    // --- Set up the editor (from the table's point of view), which is a button.
    // --- This button brings up the color chooser dialog, which is the editor 
	// --- from the user's point of view.
    button = new JButton();
    button.setBorderPainted(false);
    button.addActionListener(this);
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:12,代码来源:TableCellEditor4Color.java

示例11: createArrowButton

import javax.swing.JButton; //导入方法依赖的package包/类
protected JButton createArrowButton() {
	JButton button = new XDMButton();
	button.setIcon(XDMIconMap.getIcon("DOWN_ARROW"));
	button.setBorderPainted(false);
	button.setFocusPainted(false);
	button.setName("ComboBox.arrowButton");
	return button;
}
 
开发者ID:kmarius,项目名称:xdman,代码行数:9,代码来源:XDMComboBoxUI.java

示例12: createDetails

import javax.swing.JButton; //导入方法依赖的package包/类
private JButton createDetails(String text) {
    JButton btn = new HtmlButton(text);
    btn.setFocusable(false);
    btn.setBorder(BorderFactory.createEmptyBorder());
    btn.setBorderPainted(false);
    btn.setFocusPainted(false);
    btn.setOpaque(false);
    btn.setContentAreaFilled(false);
    btn.addActionListener(this);
    btn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    return btn;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SlownessReporter.java

示例13: addImpl

import javax.swing.JButton; //导入方法依赖的package包/类
@Override
protected void addImpl( Component comp, Object constraints, int index ) {
    super.addImpl( comp, constraints, index ); 
    if( comp instanceof JButton ) {
        JButton btn = (JButton) comp;
        btn.setContentAreaFilled( false );
        btn.setOpaque( false );
        btn.setBorder( BorderFactory.createEmptyBorder(2,2,2,2) );
        btn.setFocusable( false );
        btn.setBorderPainted( false );
        btn.setRolloverEnabled( false );
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ControlsToolbar.java

示例14: TextNotification

import javax.swing.JButton; //导入方法依赖的package包/类
public TextNotification() {
	m_fromLabel = new JLabel();
	m_titleLabel = new JLabel();
	m_titleLabel.addMouseListener(new NotificationMouseAdapter(m_titleLabel));
	
	m_subtitleArea = new JTextArea();
	m_subtitleArea.addMouseListener(new NotificationMouseAdapter(m_titleLabel));
	
	JPanel panelHeader = new JPanel();
	panelHeader.setLayout(new BoxLayout(panelHeader, BoxLayout.PAGE_AXIS));
	JButton dimissButton = new JButton();
	dimissButton.setText("X");
	final TextNotification me = this;
	dimissButton.addActionListener(new ActionListener() {

		@Override
		public void actionPerformed(ActionEvent arg0) {
			// TODO Auto-generated method stub
			me.removeFromManager();
		}
		
	});
	dimissButton.setOpaque(false);
	dimissButton.setContentAreaFilled(false);
	dimissButton.setBorderPainted(false);
	dimissButton.setBounds((int) (this.getWidth() - dimissButton.getPreferredSize().getWidth()), 0, (int) dimissButton.getPreferredSize().getWidth(), (int) dimissButton.getPreferredSize().getHeight());
	m_panel.add(dimissButton);
	
	
	panelHeader.add(m_fromLabel);
	panelHeader.add(m_titleLabel);
	this.addComponent(panelHeader, BorderLayout.NORTH);
	this.addComponent(m_subtitleArea, BorderLayout.CENTER);
}
 
开发者ID:OwaNotifier,项目名称:owa-notifier,代码行数:35,代码来源:TextNotification.java

示例15: SplashScreen

import javax.swing.JButton; //导入方法依赖的package包/类
public SplashScreen(Image image) {
	this.icon = new ImageIcon(image);

	Container container = getContentPane();
	container.setLayout(null);

	BufferedImage alphaImage = new BufferedImage(this.icon.getIconWidth(), this.icon.getIconHeight(), 2);
	Graphics2D g = alphaImage.createGraphics();
	g.drawImage(image, 0, 0, this.icon.getIconWidth(), this.icon.getIconHeight(), null);
	g.dispose();

	JButton background = new JButton(new ImageIcon(alphaImage));
	background.setBounds(0, 0, this.icon.getIconWidth(), this.icon.getIconHeight());
	background.setRolloverEnabled(true);
	background.setRolloverIcon(background.getIcon());
	background.setSelectedIcon(background.getIcon());
	background.setDisabledIcon(background.getIcon());
	background.setPressedIcon(background.getIcon());
	background.setFocusable(false);
	background.setContentAreaFilled(false);
	background.setBorderPainted(false);
	background.setOpaque(false);
	container.add(background);

	setSize(this.icon.getIconWidth(), this.icon.getIconHeight() + 20);
	try {
		setBackground(new Color(0, 0, 0, 0));
	} catch (UnsupportedOperationException e) {
		setBackground(new Color(0, 0, 0));
	}
	setLocationRelativeTo(null);
}
 
开发者ID:DivergenceBot,项目名称:Bootstrapper,代码行数:33,代码来源:SplashScreen.java


注:本文中的javax.swing.JButton.setBorderPainted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。