Search:

Type: Posts; User: javapenguin

Search: Search took 0.11 seconds.

  1. Thread: Swing Help

    by javapenguin
    Replies
    6
    Views
    1,263

    Re: Swing Help

    JTextField field = new JTextField(20);
    field.setText("Button 1");

    That is because you are referring to the field object you created that only has the scope of the ActionListener.

    Also,...
  2. Thread: Swing Help

    by javapenguin
    Replies
    6
    Views
    1,263

    Re: Swing Help

    Put this line before your actionListeners are coded.

    JTextField field = new JTextField(20);

    Right now field is null when it's going into them.
Results 1 to 2 of 2