facebook

public static swing components

  1. MyEclipse Archived
  2.  > 
  3. Matisse/Swing UI Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #269091 Reply

    1ac0
    Member

    hi!

    is it possible make swing ui components in some way public static?

    for example:

    after building in matisse, this is exception from code:

    //GEN-BEGIN:variables
    // Variables declaration – do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;

    but i would like this have in this way:

    //GEN-BEGIN:variables
    // Variables declaration – do not modify
    public static javax.swing.JButton jButton1;
    public static javax.swing.JButton jButton2;
    public static javax.swing.JLabel jLabel1;

    or is there any other right way to modify swing ui component from another class?
    class1(where are ui components) <- class2(i would like for example append(text) to textArea)

    any help?

    sorry for my english…

    #269151 Reply

    Riyad Kalla
    Member

    1ac0,
    Making the members themselves public is considered a back OO practice so typically what folks with do is right-click in the source panel and go to Source then down to Generate Getters and Setters.

    That being said, if you really wanted to make them public, you could certainly just change the accessors yourself.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: public static swing components

You must be logged in to post in the forum log in