本文整理了Java中javax.swing.JButton.setBorder()
方法的一些代码示例,展示了JButton.setBorder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JButton.setBorder()
方法的具体详情如下:
包路径:javax.swing.JButton
类名称:JButton
方法名:setBorder
暂无
代码示例来源:origin: libgdx/libgdx
private void initializeComponents (String chartTitle) {
JPanel contentPanel = getContentPanel();
{
chart = new Chart(chartTitle) {
public void pointsChanged () {
value.setTimeline(chart.getValuesX());
value.setScaling(chart.getValuesY());
}
};
chart.setPreferredSize(new Dimension(150, 62));
contentPanel.add(chart, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
}
{
expandButton = new JButton("+");
expandButton.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
contentPanel.add(expandButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
}
}
}
代码示例来源:origin: skylot/jadx
button.setContentAreaFilled(false);
button.setFocusable(false);
button.setBorder(null);
button.setBorderPainted(false);
button.addActionListener(e -> closeCodePanel(contentPanel));
代码示例来源:origin: bonnyfone/vectalign
btnMorphAnimation.setPreferredSize(new Dimension(35, 35));
btnMorphAnimation.setBorderPainted(false);
btnMorphAnimation.setBorder(null);
btnMorphAnimation.setMargin(new Insets(0, 0, 0, 0));
btnMorphAnimation.setContentAreaFilled(false);
代码示例来源:origin: libgdx/libgdx
private void initializeComponents (String chartTitle) {
JPanel contentPanel = getContentPanel();
{
chart = new Chart(chartTitle) {
public void pointsChanged () {
value.setTimeline(chart.getValuesX());
value.setScaling(chart.getValuesY());
}
};
chart.setPreferredSize(new Dimension(150, 62));
contentPanel.add(chart, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH,
new Insets(0, 0, 0, 0), 0, 0));
}
{
expandButton = new JButton("+");
expandButton.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
contentPanel.add(expandButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
}
}
}
代码示例来源:origin: redwarp/9-Patch-Resizer
this.xhdpiButton.setIcon(this.blueArrow);
this.xhdpiButton.setSelectedIcon(this.redArrow);
this.xhdpiButton.setBorder(null);
this.xhdpiButton.setContentAreaFilled(false);
inputPanel.add(this.xhdpiButton, BorderLayout.CENTER);
代码示例来源:origin: libgdx/libgdx
private void initializeComponents () {
JPanel contentPanel = getContentPanel();
{
label = new JLabel("Value:");
contentPanel.add(label, new GridBagConstraints(2, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 6), 0, 0));
}
{
minSlider = new Slider(0, -99999, 99999, 1, -400, 400);
contentPanel.add(minSlider, new GridBagConstraints(3, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
}
{
maxSlider = new Slider(0, -99999, 99999, 1, -400, 400);
contentPanel.add(maxSlider, new GridBagConstraints(4, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 6, 0, 0), 0, 0));
}
{
rangeButton = new JButton("<");
rangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
contentPanel.add(rangeButton, new GridBagConstraints(5, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
}
}
}
代码示例来源:origin: runelite/runelite
clearButton.setFont(FontManager.getRunescapeBoldFont());
clearButton.setForeground(ColorScheme.PROGRESS_ERROR_COLOR);
clearButton.setBorder(null);
clearButton.setBorderPainted(false);
clearButton.setContentAreaFilled(false);
代码示例来源:origin: libgdx/libgdx
private void initializeComponents () {
JPanel contentPanel = getContentPanel();
{
label = new JLabel("Value:");
contentPanel.add(label, new GridBagConstraints(2, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 6), 0, 0));
}
{
minSlider = new Slider(0, -99999, 99999, 1, -400, 400);
contentPanel.add(minSlider, new GridBagConstraints(3, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
}
{
maxSlider = new Slider(0, -99999, 99999, 1, -400, 400);
contentPanel.add(maxSlider, new GridBagConstraints(4, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 6, 0, 0), 0, 0));
}
{
rangeButton = new JButton("<");
rangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
contentPanel.add(rangeButton, new GridBagConstraints(5, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
}
}
}
代码示例来源:origin: stackoverflow.com
JButton button = new JButton();
button.setBorderPainted(false);
button.setBorder(null);
//button.setFocusable(false);
button.setMargin(new Insets(0, 0, 0, 0));
button.setContentAreaFilled(false);
button.setIcon(myIcon1);
button.setRolloverIcon(myIcon2);
button.setPressedIcon(myIcon3);
button.setDisabledIcon(myIcon4);
代码示例来源:origin: libgdx/libgdx
expandButton.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
contentPanel.add(expandButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
代码示例来源:origin: libgdx/libgdx
expandButton.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
contentPanel.add(expandButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
代码示例来源:origin: libgdx/libgdx
highRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
formPanel.add(highRangeButton, new GridBagConstraints(5, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
lowRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
formPanel.add(lowRangeButton, new GridBagConstraints(5, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
contentPanel.add(expandButton, new GridBagConstraints(7, 5, 1, 1, 0, 0, GridBagConstraints.SOUTHWEST,
GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
expandButton.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
代码示例来源:origin: libgdx/libgdx
highRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
formPanel.add(highRangeButton, new GridBagConstraints(5, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
lowRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
formPanel.add(lowRangeButton, new GridBagConstraints(5, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
contentPanel.add(expandButton, new GridBagConstraints(7, 5, 1, 1, 0, 0, GridBagConstraints.SOUTHWEST,
GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
expandButton.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
代码示例来源:origin: libgdx/libgdx
rangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
contentPanel.add(rangeButton, new GridBagConstraints(5, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
代码示例来源:origin: libgdx/libgdx
rangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
contentPanel.add(rangeButton, new GridBagConstraints(5, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
代码示例来源:origin: libgdx/libgdx
highRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
formPanel.add(highRangeButton, new GridBagConstraints(5, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
lowRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
formPanel.add(lowRangeButton, new GridBagConstraints(5, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
contentPanel.add(expandButton, new GridBagConstraints(7, 5, 1, 1, 1, 0, GridBagConstraints.SOUTHWEST,
GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
expandButton.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
代码示例来源:origin: libgdx/libgdx
highRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
formPanel.add(highRangeButton, new GridBagConstraints(5, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
lowRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
formPanel.add(lowRangeButton, new GridBagConstraints(5, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
contentPanel.add(expandButton, new GridBagConstraints(7, 5, 1, 1, 1, 0, GridBagConstraints.SOUTHWEST,
GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
expandButton.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
代码示例来源:origin: stackoverflow.com
BufferedImage startButton = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup.png"));
BufferedImage startButtonHover = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_hover.png"));
BufferedImage startButtonActive = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_active.png"));
JButton startBackupButton = new JButton(new ImageIcon(startButton));
startBackupButton.setRolloverIcon(new ImageIcon(startButtonHover));
startBackupButton.setPressedIcon(new ImageIcon(startButtonActive));
startBackupButton.setBorder(BorderFactory.createEmptyBorder());
startBackupButton.setContentAreaFilled(false);
startBackupButton.setFocusable(false);
代码示例来源:origin: ron190/jsql-injection
@Override public void mouseExited(MouseEvent e) {
if (this.buttonFlat.isEnabled() && !this.isVisible) {
this.buttonFlat.setContentAreaFilled(false);
this.buttonFlat.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
}
}
代码示例来源:origin: ron190/jsql-injection
@Override public void mouseEntered(MouseEvent e) {
if (this.buttonFlat.isEnabled() && !this.isVisible) {
this.buttonFlat.setContentAreaFilled(true);
this.buttonFlat.setBorder(HelperUi.BORDER_ROUND_BLU);
}
}
内容来源于网络,如有侵权,请联系作者删除!