public static void main(String args[]) {

    JFrame frame = new JFrame("Test prefs Field");
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {System.exit(0);}
    });

    PrefPanel.Dialog d = new PrefPanel.Dialog(frame, false, "title", null, null);
    PrefPanel pp = d.getPrefPanel();
    final Field.Text tf = pp.addTextField("text", "text", "defValue");
    pp.setCursor(1, 0);
    pp.addTextField("text2", "text2", "text2");
    //final Field.Int intf = pp.addIntField("int", "int", 66);

    tf.setText("better value");
    d.finish();
    d.show();

    JPanel main = new JPanel(new FlowLayout());
    frame.getContentPane().add(main);
    main.setPreferredSize(new Dimension(200, 200));

    frame.pack();
    frame.setLocation(300, 300);
    frame.setVisible(true);

    pp.addActionListener(e -> {
        String text = tf.getText();
        tf.setText( text+"1");
    });

  }
public static void main(String args[]) {

    JFrame frame = new JFrame("Test prefs Field");
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {System.exit(0);}
    });

    PrefPanel.Dialog d = new PrefPanel.Dialog(frame, false, "title", null, null);
    PrefPanel pp = d.getPrefPanel();
    final Field.Text tf = pp.addTextField("text", "text", "defValue");
    pp.setCursor(1, 0);
    pp.addTextField("text2", "text2", "text2");
    

    tf.setText("better value");
    d.finish();
    d.show();

    JPanel main = new JPanel(new FlowLayout());
    frame.getContentPane().add(main);
    main.setPreferredSize(new Dimension(200, 200));

    frame.pack();
    frame.setLocation(300, 300);
    frame.setVisible(true);

    pp.addActionListener(e -> {
        String text = tf.getText();
        tf.setText( text+"1");
    });

  }
public static void main ( String args [ ] ) { JFrame frame = new JFrame ( "Test prefs Field" ) ; frame . addWindowListener ( new WindowAdapter ( ) { public void windowClosing ( WindowEvent e ) { System . exit ( 0 ) ; } } ) ; PrefPanel . Dialog d = new PrefPanel . Dialog ( frame , false , "title" , null , null ) ; PrefPanel pp = d . getPrefPanel ( ) ; final Field . Text tf = pp . addTextField ( "text" , "text" , "defValue" ) ; pp . setCursor ( 1 , 0 ) ; pp . addTextField ( "text2" , "text2" , "text2" ) ; //final Field.Int intf = pp.addIntField("int", "int", 66); tf . setText ( "better value" ) ; d . finish ( ) ; d . show ( ) ; JPanel main = new JPanel ( new FlowLayout ( ) ) ; frame . getContentPane ( ) . add ( main ) ; main . setPreferredSize ( new Dimension ( 200 , 200 ) ) ; frame . pack ( ) ; frame . setLocation ( 300 , 300 ) ; frame . setVisible ( true ) ; pp . addActionListener ( e -> { String text = tf . getText ( ) ; tf . setText ( text + "1" ) ; } ) ; }
test
test