Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JButton S1L1Reset = new JButton("Reset");
- S1L1Reset.setFont(new Font("Work Sans", Font.PLAIN, 14));
- S1L1Reset.setForeground(new Color(90, 90, 90));
- S1L1Reset.setBackground(new Color(220, 208, 192));
- S1L1Reset.setOpaque(true);
- class RoundedBorder implements Border {
- private int radius;
- RoundedBorder(int radius) {
- this.radius = radius;
- }
- public Insets getBorderInsets(Component c) {
- return new Insets(this.radius+1, this.radius+1, this.radius+2, this.radius);
- }
- public boolean isBorderOpaque() {
- return true;
- }
- public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
- g.drawRoundRect(x, y, width-1, height-1, radius, radius);
- }
- }
- JButton S1L1Reset = new JButton("Reset");
- S1L1Reset.setFont(new Font("Work Sans", Font.PLAIN, 14));
- S1L1Reset.setForeground(new Color(90, 90, 90));
- S1L1Reset.setBackground(new Color(220, 208, 192));
- S1L1Reset.setOpaque(true);
- S1L1Reset.setBorderPainted(false);
- S1L1Reset.setBorder(new RoundedBorder(20)); //new line of code added
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement