Results 1 to 3 of 3

Thread: Ques

  1. #1
    Join Date
    Jul 2011
    Posts
    47
    Rep Power
    0

    Default Ques

    why this two kind of code have different?

    private FlowLayout layout;
    layout = new FlowLayout();
    setLayout(layout);

    ////////////

    setLayout(new FlowLayout());

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default

    In the first one the developer presumably needed to have access to the layout object elsewhere in the code.
    Or at least thought they did.

  3. #3
    Hibernate's Avatar
    Hibernate is offline Senior Member
    Join Date
    Dec 2010
    Location
    Stockholm, Sweden
    Posts
    222
    Blog Entries
    9
    Rep Power
    4

    Default

    I really think this thread should be renamed, »ques» is not even a word.
    Maybe »Declaring layout managers» would be more suitable.
    Ex animo! Hibernate
    Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.

Similar Threads

  1. confusing ques
    By rok0016 in forum New To Java
    Replies: 6
    Last Post: 07-15-2010, 06:07 PM
  2. need help with this java 2d ques
    By rtm09 in forum Advanced Java
    Replies: 1
    Last Post: 04-14-2009, 09:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •