challengee

This commit is contained in:
Josh Ashton
2023-11-15 10:48:03 -07:00
parent edce1d4ff9
commit 2feee0f8e8
11 changed files with 39 additions and 23 deletions
+18 -4
View File
@@ -1,7 +1,6 @@
import javax.swing.JPanel;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.*;
public class Panel extends JPanel {
private Color bg;
@@ -19,6 +18,21 @@ public class Panel extends JPanel {
setBackground(bg);
setForeground(fg);
add(new Button("Example text", new Color(160, 32, 240), Color.WHITE));
Button b = new Button("Example text", new Color(160, 32, 240), Color.WHITE);
b.addActionListener(
e -> {
System.out.println("Button action.");
}
);
Button b2 = new Button("Example 2 text", new Color(160, 32, 240), Color.WHITE);
b2.addActionListener(
e -> {
System.out.println("Button 2 action.");
}
);
add(b);
add(b2);
}
}