001: /*
002: * RenameComponentVariableTestFrame.java
003: *
004: * Created on June 5, 2007, 12:33 PM
005: */
006:
007: package data;
008:
009: import javax.swing.ButtonModel;
010: import javax.swing.JButton;
011:
012: /**
013: *
014: * @author jirka
015: */
016: public class RenameComponentVariableTestFrame extends
017: javax.swing.JFrame {
018:
019: /** Creates new form RenameComponentVariableTestFrame */
020: public RenameComponentVariableTestFrame() {
021: initComponents();
022: jButton1.setEnabled(true);
023: JButton myButton = jButton1;
024: }
025:
026: /** This method is called from within the constructor to
027: * initialize the form.
028: * WARNING: Do NOT modify this code. The content of this method is
029: * always regenerated by the Form Editor.
030: */
031: // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
032: private void initComponents() {
033: bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
034:
035: jButton1 = new javax.swing.JButton();
036: jLabel1 = new javax.swing.JLabel();
037:
038: setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
039:
040: org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings
041: .createAutoBinding(
042: org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
043: jButton1, org.jdesktop.beansbinding.ELProperty
044: .create("${text}"), this ,
045: org.jdesktop.beansbinding.BeanProperty
046: .create("title"));
047: bindingGroup.addBinding(binding);
048:
049: java.util.ResourceBundle bundle = java.util.ResourceBundle
050: .getBundle("data/Bundle"); // NOI18N
051: jButton1
052: .setText(bundle
053: .getString("RenameComponentVariableTestFrame.jButton1.text")); // NOI18N
054: jButton1.addActionListener(new java.awt.event.ActionListener() {
055: public void actionPerformed(java.awt.event.ActionEvent evt) {
056: jButton1ActionPerformed(evt);
057: }
058: });
059:
060: jLabel1.setText("jLabel1");
061:
062: org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
063: getContentPane());
064: getContentPane().setLayout(layout);
065: layout
066: .setHorizontalGroup(layout
067: .createParallelGroup(
068: org.jdesktop.layout.GroupLayout.LEADING)
069: .add(
070: layout
071: .createSequentialGroup()
072: .add(
073: layout
074: .createParallelGroup(
075: org.jdesktop.layout.GroupLayout.TRAILING)
076: .add(
077: org.jdesktop.layout.GroupLayout.LEADING,
078: layout
079: .createSequentialGroup()
080: .add(
081: 30,
082: 30,
083: 30)
084: .add(
085: jButton1))
086: .add(jLabel1))
087: .addContainerGap(58,
088: Short.MAX_VALUE)));
089: layout.setVerticalGroup(layout.createParallelGroup(
090: org.jdesktop.layout.GroupLayout.LEADING).add(
091: layout.createSequentialGroup().add(25, 25, 25).add(
092: jButton1).add(56, 56, 56).add(jLabel1)
093: .addContainerGap(40, Short.MAX_VALUE)));
094:
095: bindingGroup.bind();
096:
097: pack();
098: }// </editor-fold>//GEN-END:initComponents
099:
100: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
101: ButtonModel model = jButton1.getModel();
102: }//GEN-LAST:event_jButton1ActionPerformed
103:
104: private void myLocalButtonWithSameName() {
105: JButton jButton1 = new JButton();
106: JButton jButton2 = jButton1;
107: JButton jButton3 = jButton2;
108: }
109:
110: private void myFooFunction() {
111: String actualButtonText = this .jButton1.getText();
112: }
113:
114: /**
115: * @param args the command line arguments
116: */
117: public static void main(String args[]) {
118: java.awt.EventQueue.invokeLater(new Runnable() {
119: public void run() {
120: new RenameComponentVariableTestFrame().setVisible(true);
121: }
122: });
123: }
124:
125: // Variables declaration - do not modify//GEN-BEGIN:variables
126: private javax.swing.JButton jButton1;
127: private javax.swing.JLabel jLabel1;
128: private org.jdesktop.beansbinding.BindingGroup bindingGroup;
129: // End of variables declaration//GEN-END:variables
130:
131: }
|