ok spróbuje, a powiedz mi jak moge zmienic np metode private ActionListener na PUBLIC w NetBeansie cokolwiek zrobie to narzuca mi pewien schemat i nie moge tego recznie wyedytowac ... wczoraj jeszcze dwie godziny siedziałęm nad wprowadzaniem MASKI dla jTextField i znalazlem opcje w google: "JFormattedTextField" niestety w NetBeansie nie moge kontrolki sobie tak z palca dodac nie wiem jak to zrobic ... świeżakuje w tym i jest tyle trudnosci :/
a z tematem poradzilem sobie tak
Frame One:
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
ramka1 ET = new ramka1();
ET.parent = this;
ET.setVisible(true);
ET.setLocationRelativeTo(null);
ET.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
oraz edit1:
public class ramka1 extends javax.swing.JFrame {
public FrameOne parent;
/** Creates new form ramka1 */
public ramka1() {
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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jTextField1 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel1.setText("Wprowadź nazwę firmy:");
jButton1.setText("Zawierdź nową nazwę firmy");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
.addComponent(jLabel1)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String str = jTextField1.getText();
parent.nazwaFirmy(str);
jTextField1.setText("");
jLabel1.setText("Wprowadź nową nazwę firmy: NAZWA WPROWADZONA !!");
JOptionPane.showMessageDialog(null, "Dane zostały zaktualizowane !");
}
/**
* @para