Results 1 to 3 of 3
  1. #1
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default Style of writing

    Hello everyone.
    I know that when you want to run a simple code you'll use the main method and run it, and when you want to make a class that you'll create instances from it
    you will make the constructor and all the other methods you want to(I forgot how this kind of class are called but that's not the point).

    When I started to work with GUI I got confused, should I write it on the main method and run it?or to make a class for it with a constructor and many other methods that will simplefy the code.
    What is the most common way to work with GUI's?

    Sorry for my bad english.

  2. #2
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default Re: Style of writing

    no one?

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Style of writing

    Go through SSCCEs posted in the AWT/Swing forum by members with a few hundred posts or more and draw your own conclusions. But just remember that those are SSCCEs, where one of the focus areas is to include everything in one .java file, hence one public class.

    Any real life application or exercise won't be limited to a single public class, and a GUI based application of any complexity will follow a design pattern, most commonly MVC (model-view-controller).

    Whatever approach you adopt, educate yourself about Swing's single threaded rule and concurrency related issues early on.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Data management (facebook style)
    By Jossos in forum New To Java
    Replies: 15
    Last Post: 01-08-2012, 02:39 AM
  2. Artistic Style 2.02.1
    By java software in forum Java Software
    Replies: 0
    Last Post: 12-24-2011, 07:00 PM
  3. Google Style Button - Has it been done before?
    By SilentSoul in forum AWT / Swing
    Replies: 9
    Last Post: 10-13-2011, 04:42 AM
  4. Replies: 1
    Last Post: 10-31-2010, 08:41 PM
  5. Cascading Style Sheets
    By smart in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 12-27-2008, 06:25 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
  •