0 Replies Latest reply: Apr 30, 2009 4:12 AM by 807581 RSS

    get/set method value

      Hi I've a problem with Java get and set methods,
      i have a GUI that is composed by a form and a panel, it contain a JTextFiel and a JButton, when I press the button I set a variable with the value of the textfield, then I would to use it in another class.
      Public JPanel createPanel(){
      panel.add(this.mailField = new JTextField("Insert mail",40));
      panel.add(this.button = new JButton("Click to Create a Certificate"));

      this.button.addMouseListener(new MouseAdapter(){
      public void mousePressed(MouseEvent e) {
      return panel;

      then I've the normal get and set methods,
      When I call the method in the other class it gives me the value of writedMail when I initialize the form (null) but I want the value when I press the button.