javax.swing.JButton.setBorder()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(227)

本文整理了Java中javax.swing.JButton.setBorder()方法的一些代码示例,展示了JButton.setBorder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JButton.setBorder()方法的具体详情如下:
包路径:javax.swing.JButton
类名称:JButton
方法名:setBorder

JButton.setBorder介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

  1. private void initializeComponents (String chartTitle) {
  2. JPanel contentPanel = getContentPanel();
  3. {
  4. chart = new Chart(chartTitle) {
  5. public void pointsChanged () {
  6. value.setTimeline(chart.getValuesX());
  7. value.setScaling(chart.getValuesY());
  8. }
  9. };
  10. chart.setPreferredSize(new Dimension(150, 62));
  11. contentPanel.add(chart, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH,
  12. new Insets(0, 0, 0, 0), 0, 0));
  13. }
  14. {
  15. expandButton = new JButton("+");
  16. expandButton.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
  17. contentPanel.add(expandButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
  18. GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
  19. }
  20. }
  21. }

代码示例来源:origin: skylot/jadx

  1. button.setContentAreaFilled(false);
  2. button.setFocusable(false);
  3. button.setBorder(null);
  4. button.setBorderPainted(false);
  5. button.addActionListener(e -> closeCodePanel(contentPanel));

代码示例来源:origin: bonnyfone/vectalign

  1. btnMorphAnimation.setPreferredSize(new Dimension(35, 35));
  2. btnMorphAnimation.setBorderPainted(false);
  3. btnMorphAnimation.setBorder(null);
  4. btnMorphAnimation.setMargin(new Insets(0, 0, 0, 0));
  5. btnMorphAnimation.setContentAreaFilled(false);

代码示例来源:origin: libgdx/libgdx

  1. private void initializeComponents (String chartTitle) {
  2. JPanel contentPanel = getContentPanel();
  3. {
  4. chart = new Chart(chartTitle) {
  5. public void pointsChanged () {
  6. value.setTimeline(chart.getValuesX());
  7. value.setScaling(chart.getValuesY());
  8. }
  9. };
  10. chart.setPreferredSize(new Dimension(150, 62));
  11. contentPanel.add(chart, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.BOTH,
  12. new Insets(0, 0, 0, 0), 0, 0));
  13. }
  14. {
  15. expandButton = new JButton("+");
  16. expandButton.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
  17. contentPanel.add(expandButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
  18. GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
  19. }
  20. }
  21. }

代码示例来源:origin: redwarp/9-Patch-Resizer

  1. this.xhdpiButton.setIcon(this.blueArrow);
  2. this.xhdpiButton.setSelectedIcon(this.redArrow);
  3. this.xhdpiButton.setBorder(null);
  4. this.xhdpiButton.setContentAreaFilled(false);
  5. inputPanel.add(this.xhdpiButton, BorderLayout.CENTER);

代码示例来源:origin: libgdx/libgdx

  1. private void initializeComponents () {
  2. JPanel contentPanel = getContentPanel();
  3. {
  4. label = new JLabel("Value:");
  5. contentPanel.add(label, new GridBagConstraints(2, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
  6. new Insets(0, 0, 0, 6), 0, 0));
  7. }
  8. {
  9. minSlider = new Slider(0, -99999, 99999, 1, -400, 400);
  10. contentPanel.add(minSlider, new GridBagConstraints(3, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  11. new Insets(0, 0, 0, 0), 0, 0));
  12. }
  13. {
  14. maxSlider = new Slider(0, -99999, 99999, 1, -400, 400);
  15. contentPanel.add(maxSlider, new GridBagConstraints(4, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  16. new Insets(0, 6, 0, 0), 0, 0));
  17. }
  18. {
  19. rangeButton = new JButton("<");
  20. rangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  21. contentPanel.add(rangeButton, new GridBagConstraints(5, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST,
  22. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  23. }
  24. }
  25. }

代码示例来源:origin: runelite/runelite

  1. clearButton.setFont(FontManager.getRunescapeBoldFont());
  2. clearButton.setForeground(ColorScheme.PROGRESS_ERROR_COLOR);
  3. clearButton.setBorder(null);
  4. clearButton.setBorderPainted(false);
  5. clearButton.setContentAreaFilled(false);

代码示例来源:origin: libgdx/libgdx

  1. private void initializeComponents () {
  2. JPanel contentPanel = getContentPanel();
  3. {
  4. label = new JLabel("Value:");
  5. contentPanel.add(label, new GridBagConstraints(2, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE,
  6. new Insets(0, 0, 0, 6), 0, 0));
  7. }
  8. {
  9. minSlider = new Slider(0, -99999, 99999, 1, -400, 400);
  10. contentPanel.add(minSlider, new GridBagConstraints(3, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  11. new Insets(0, 0, 0, 0), 0, 0));
  12. }
  13. {
  14. maxSlider = new Slider(0, -99999, 99999, 1, -400, 400);
  15. contentPanel.add(maxSlider, new GridBagConstraints(4, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  16. new Insets(0, 6, 0, 0), 0, 0));
  17. }
  18. {
  19. rangeButton = new JButton("<");
  20. rangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  21. contentPanel.add(rangeButton, new GridBagConstraints(5, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST,
  22. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  23. }
  24. }
  25. }

代码示例来源:origin: stackoverflow.com

  1. JButton button = new JButton();
  2. button.setBorderPainted(false);
  3. button.setBorder(null);
  4. //button.setFocusable(false);
  5. button.setMargin(new Insets(0, 0, 0, 0));
  6. button.setContentAreaFilled(false);
  7. button.setIcon(myIcon1);
  8. button.setRolloverIcon(myIcon2);
  9. button.setPressedIcon(myIcon3);
  10. button.setDisabledIcon(myIcon4);

代码示例来源:origin: libgdx/libgdx

  1. expandButton.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
  2. contentPanel.add(expandButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
  3. GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));

代码示例来源:origin: libgdx/libgdx

  1. expandButton.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
  2. contentPanel.add(expandButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
  3. GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));

代码示例来源:origin: libgdx/libgdx

  1. highRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  2. formPanel.add(highRangeButton, new GridBagConstraints(5, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST,
  3. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  4. lowRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  5. formPanel.add(lowRangeButton, new GridBagConstraints(5, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST,
  6. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  7. contentPanel.add(expandButton, new GridBagConstraints(7, 5, 1, 1, 0, 0, GridBagConstraints.SOUTHWEST,
  8. GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
  9. expandButton.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));

代码示例来源:origin: libgdx/libgdx

  1. highRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  2. formPanel.add(highRangeButton, new GridBagConstraints(5, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST,
  3. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  4. lowRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  5. formPanel.add(lowRangeButton, new GridBagConstraints(5, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST,
  6. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  7. contentPanel.add(expandButton, new GridBagConstraints(7, 5, 1, 1, 0, 0, GridBagConstraints.SOUTHWEST,
  8. GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
  9. expandButton.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));

代码示例来源:origin: libgdx/libgdx

  1. rangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  2. contentPanel.add(rangeButton, new GridBagConstraints(5, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST,
  3. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));

代码示例来源:origin: libgdx/libgdx

  1. rangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  2. contentPanel.add(rangeButton, new GridBagConstraints(5, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST,
  3. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));

代码示例来源:origin: libgdx/libgdx

  1. highRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  2. formPanel.add(highRangeButton, new GridBagConstraints(5, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST,
  3. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  4. lowRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  5. formPanel.add(lowRangeButton, new GridBagConstraints(5, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST,
  6. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  7. contentPanel.add(expandButton, new GridBagConstraints(7, 5, 1, 1, 1, 0, GridBagConstraints.SOUTHWEST,
  8. GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
  9. expandButton.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));

代码示例来源:origin: libgdx/libgdx

  1. highRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  2. formPanel.add(highRangeButton, new GridBagConstraints(5, 1, 1, 1, 0.0, 0, GridBagConstraints.WEST,
  3. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  4. lowRangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  5. formPanel.add(lowRangeButton, new GridBagConstraints(5, 2, 1, 1, 0.0, 0, GridBagConstraints.WEST,
  6. GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0));
  7. contentPanel.add(expandButton, new GridBagConstraints(7, 5, 1, 1, 1, 0, GridBagConstraints.SOUTHWEST,
  8. GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
  9. expandButton.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));

代码示例来源:origin: stackoverflow.com

  1. BufferedImage startButton = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup.png"));
  2. BufferedImage startButtonHover = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_hover.png"));
  3. BufferedImage startButtonActive = ImageIO.read(getClass().getResource("/icons/standard/buttons/start_backup_active.png"));
  4. JButton startBackupButton = new JButton(new ImageIcon(startButton));
  5. startBackupButton.setRolloverIcon(new ImageIcon(startButtonHover));
  6. startBackupButton.setPressedIcon(new ImageIcon(startButtonActive));
  7. startBackupButton.setBorder(BorderFactory.createEmptyBorder());
  8. startBackupButton.setContentAreaFilled(false);
  9. startBackupButton.setFocusable(false);

代码示例来源:origin: ron190/jsql-injection

  1. @Override public void mouseExited(MouseEvent e) {
  2. if (this.buttonFlat.isEnabled() && !this.isVisible) {
  3. this.buttonFlat.setContentAreaFilled(false);
  4. this.buttonFlat.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
  5. }
  6. }

代码示例来源:origin: ron190/jsql-injection

  1. @Override public void mouseEntered(MouseEvent e) {
  2. if (this.buttonFlat.isEnabled() && !this.isVisible) {
  3. this.buttonFlat.setContentAreaFilled(true);
  4. this.buttonFlat.setBorder(HelperUi.BORDER_ROUND_BLU);
  5. }
  6. }

相关文章

JButton类方法