Search:

Type: Posts; User: bbr201

Search: Search took 0.10 seconds.

  1. Replies
    4
    Views
    1,762

    Re: scope - quick question

    Hmm, I guess I'm just confused as to why you wouldn't make it like this:


    class MyClass{
    JButton but;
    ...

    MyClass(){
    but = new JButton("Test");
    ...
  2. Replies
    4
    Views
    1,762

    Re: scope - quick question

    I guess another way of thinking about the same question is: what happens when you add the button to the content pane? Is another reference to the JButton object created somewhere?
  3. Replies
    4
    Views
    1,762

    scope - quick question

    hi all,

    i am looking at some very simple beginner swing applications and i have a quick question. in the examples given, certain components are created within the constructor of the class:


    ...
Results 1 to 3 of 3