-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJInternalFrame_current.java
executable file
·55 lines (50 loc) · 1.66 KB
/
JInternalFrame_current.java
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* JInternalFrame_current.java
*
* Created on 21 òðàâíÿ 2008, 16:07
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package example;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.swing.event.*;
/**
*
* @author Technik
*/
public class JInternalFrame_current extends JInternalFrame{
/** Creates a new instance of JInternalFrame_current */
public JInternalFrame_current(JDesktopPane desktop) {
super("JInternalFrame",false,false,false);
this.setBounds(1,1,190,190);
JButton button_set=new JButton("SET");
JButton button_unset=new JButton("UNSET");
button_set.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
on_button_set_click();
}
});
button_unset.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
on_button_unset_click();
}
});
JPanel panel_main=new JPanel(new BorderLayout());
panel_main.add(button_set,BorderLayout.NORTH);
panel_main.add(button_unset,BorderLayout.SOUTH);
this.getContentPane().add(panel_main);
desktop.add(this);
this.setVisible(true);
}
private void on_button_set_click(){
this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
}
private void on_button_unset_click(){
this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
}