Results 1 to 7 of 7
  1. #1
    Bmorebob is offline Member
    Join Date
    Mar 2011
    Location
    Manassas, VA
    Posts
    14
    Rep Power
    0

    Default [SOLVED] Layout errors, windows shows but no components

    I'm trying to create a login screen but I can't figure out the best way to configure the layout...any ideas/suggestions are appreciated!
    Last edited by Bmorebob; 03-20-2011 at 07:30 PM. Reason: DB pointed out some mistakes I made in asking the question

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,234
    Rep Power
    19

    Default

    1. To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem. Note that the code you posted is NOT a SSCCE on at least three accounts:
    -- doesn't compile
    -- lots of code unrelated to the stated problem
    -- no main(...) method

    Also, the code you posted isn't the code that produced the error trace.
    -- the exception was thrown from line 80 of Login.java in the constructor. In the code posted, line 80 isn't in the contructor.
    -- the error trace includes a MainMenu class with a DBListener inner class which isn't present in the posted code.

    I suggest you go through How to ask questions the smart way

    db
    Last edited by DarrylBurke; 03-19-2011 at 08:13 AM.

  3. #3
    Bmorebob is offline Member
    Join Date
    Mar 2011
    Location
    Manassas, VA
    Posts
    14
    Rep Power
    0

    Default

    Thanks db, I've edited the code in the question to make it SCCE, with the error that's being outputted it's still compiling...but something in my layout is screwed up and I can't figure it out...

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,234
    Rep Power
    19

    Default

    That's a warning, not an error. The warning contains an instruction on how to obtain details, did you do that?
    Recompile with -Xlint:deprecation for details.
    Moreover, that warning doesn't arise from the code posted.

    Also, the posted code still has one error -- a missing semicolon.

    db

  5. #5
    Bmorebob is offline Member
    Join Date
    Mar 2011
    Location
    Manassas, VA
    Posts
    14
    Rep Power
    0

    Default

    Oh....when I run it the window shows but again, no components.

    Here's the layout I'm trying to get...more or less: http://www.google.com/imgres?imgurl=...w=1440&bih=772
    Last edited by Bmorebob; 03-20-2011 at 07:31 PM.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,234
    Rep Power
    19

    Default

    Constructing a JPanel and assigning it to a variable called contentPane doesn't automagically make it the contentPane of a JFrame. I don't see where you add(...) the panel to the frame.

    Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)

    db

  7. #7
    Bmorebob is offline Member
    Join Date
    Mar 2011
    Location
    Manassas, VA
    Posts
    14
    Rep Power
    0

    Default

    Awesome! I went ahead and formatted with Absolute Positioning, works great!
    Thanks so much!
    Last edited by Bmorebob; 03-19-2011 at 07:38 PM.

Similar Threads

  1. Replies: 4
    Last Post: 06-07-2009, 12:59 AM
  2. Replies: 3
    Last Post: 06-07-2009, 12:14 AM
  3. Replies: 12
    Last Post: 05-26-2009, 01:48 PM
  4. Replies: 10
    Last Post: 01-29-2009, 08:00 AM
  5. Replies: 1
    Last Post: 08-06-2007, 06:04 PM

Tags for this Thread

Posting Permissions

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