本文整理汇总了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;
}
示例2: setupButton
import javax.swing.JButton; //导入方法依赖的package包/类
private void setupButton(JButton button)
{
applyFlatterLaF(button);
button.setBorderPainted(false);
button.setIconTextGap(10);
button.addActionListener(this);
}
示例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;
}
示例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;
}
示例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);
}
});
}
示例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;
}
示例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);
}
}
示例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));
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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 );
}
}
示例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);
}
示例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);
}