-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path69_MouseListener
More file actions
33 lines (26 loc) · 841 Bytes
/
69_MouseListener
File metadata and controls
33 lines (26 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// JColorChooser = A GUI mechanism that let's a user choose a color
<Main.java>
public class Main {
public static void main(String[] args) {
new MyFram();
}
}
<MyFram.java>
import javax.swing.*;
import java.awt.*;
public class ProgressBarDemo {
JFrame frame = new JFrame();
JProgressBar bar = new JProgressBar();
ProgressBarDemo(){
bar.setValue(0);
bar.setBounds(0,0,420,50);
bar.setStringPainted(true); //percentage will change when set value
bar.setFont(new Font("MV Boli",Font.BOLD,25));
bar.setForeground(Color.red); //fill colour
bar.setBackground(Color.black); //bar ori colour unfilled
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(420,420);
frame.setLayout(null);
frame.setVisible(true);
}
}