blob: 7dc5a3c4a6d027b3c6083e6b0903de7a6f0b985c (
plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
/*
* NewJFrame.java
*
* Created on August 18, 2007, 4:53 PM
*/
package javaapplication4;
import javax.swing.JFrame;
import javax.swing.JLabel;
/**
*
* @author root
*/
public class NewJFrame extends javax.swing.JFrame {
/** Creates new form NewJFrame */
public NewJFrame() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
popupButton1 = new org.tigris.toolbar.toolbutton.PopupButton();
toolBar1 = new org.tigris.toolbar.ToolBar();
popupButton2 = new org.tigris.toolbar.toolbutton.PopupButton();
getContentPane().setLayout(new java.awt.GridLayout());
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Toolbar stuff test");
popupButton1.setText("CLICK ME");
popupButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
popupButton1MouseClicked(evt);
}
});
getContentPane().add(popupButton1);
popupButton2.setText("CLick me To!");
popupButton2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
popupButton2MouseClicked(evt);
}
});
toolBar1.add(popupButton2);
getContentPane().add(toolBar1);
pack();
}// </editor-fold>//GEN-END:initComponents
private void popupButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_popupButton2MouseClicked
// TODO add your handling code here:
JFrame f = new JFrame("weeeeeeeeeeee");
f.getContentPane().add(new JLabel("Why did you click me? :o"));
f.pack();
f.setVisible(true);
}//GEN-LAST:event_popupButton2MouseClicked
private void popupButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_popupButton1MouseClicked
// TODO add your handling code here:
JFrame f = new JFrame ("Hello, World!");
f.getContentPane().add (new JLabel("Hello, World!"));
f.pack();
f.setVisible(true);
System.out.println("Hello World!");
}//GEN-LAST:event_popupButton1MouseClicked
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private org.tigris.toolbar.toolbutton.PopupButton popupButton1;
private org.tigris.toolbar.toolbutton.PopupButton popupButton2;
private org.tigris.toolbar.ToolBar toolBar1;
// End of variables declaration//GEN-END:variables
}
|