Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes empty Jframe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "empty Jframe" Watch "empty Jframe" New topic
Author

empty Jframe

Tom Grant
Greenhorn

Joined: Apr 06, 2012
Posts: 7
Hey im quite new to java (and this forum)and this is a class for an IRC bot i am experimenting with using the pircbotx 1.6 api. I have a frame from another class that opens and gets disposed before this is called. When this frame opens it is just an empty frame that you cant see have i done something wrong in the code or is this caused by something else?
Here is the class (I put it on pastebin as it is 258 lines long): Display.class
Also i originally had it without the JTabbedPane (still the problem mentioned above) have i added it correctly as i have never used it before?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Welcome to the Ranch!

I suggest you strip out any non-UI code and turn it into an SSCCE (<= link), then post it here. If it's 258 lines with all the client code it should definitely be small enough as an SSCCE to post here.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Tom Grant
Greenhorn

Joined: Apr 06, 2012
Posts: 7
Rob Spoor wrote:Welcome to the Ranch!

I suggest you strip out any non-UI code and turn it into an SSCCE (<= link), then post it here. If it's 258 lines with all the client code it should definitely be small enough as an SSCCE to post here.


this good?

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Tom Grant wrote:
Rob Spoor wrote:Welcome to the Ranch!

I suggest you strip out any non-UI code and turn it into an SSCCE (<= link), then post it here. If it's 258 lines with all the client code it should definitely be small enough as an SSCCE to post here.


this good?

Nope. Did you go through the SSCCE page? The idea is that we can copy your code into a file, compile and run it to see where the problem might be.

Uncompilable snippets rarely reveal the problem; in fact, we often see here that the root cause of the stated problem was in code not initially posted.


luck, db
There are no new questions, but there may be new answers.
Tom Grant
Greenhorn

Joined: Apr 06, 2012
Posts: 7
Darryl Burke wrote:
Tom Grant wrote:
Rob Spoor wrote:Welcome to the Ranch!

I suggest you strip out any non-UI code and turn it into an SSCCE (<= link), then post it here. If it's 258 lines with all the client code it should definitely be small enough as an SSCCE to post here.


this good?

Nope. Did you go through the SSCCE page? The idea is that we can copy your code into a file, compile and run it to see where the problem might be.

Uncompilable snippets rarely reveal the problem; in fact, we often see here that the root cause of the stated problem was in code not initially posted.

oh i see now sorry :
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> oh i see now sorry :

do yourself a favor - create another class file, copy/paste your latest code and try to compile,
just as if you were someone else reading this thread.

most people, seeing the resulting error message/s, are likely to just click 'next', ignoring your problem.

I don't know what is supposed to show up, but if it is the buttons, this line won't help
for(i=0;i>button.length;i++){

as for the rest of the code, unless you've a career in code obfuscation, it's a shocker
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

That code is quite bad to read. I suggest you completely rework it:
1) Do not use static variables for your components.
2) Give the components better names. I have no idea what field should be placed where and what its purpose it.
Tom Grant
Greenhorn

Joined: Apr 06, 2012
Posts: 7
Michael Dunn wrote:> oh i see now sorry :

do yourself a favor - create another class file, copy/paste your latest code and try to compile,
just as if you were someone else reading this thread.

most people, seeing the resulting error message/s, are likely to just click 'next', ignoring your problem.

I don't know what is supposed to show up, but if it is the buttons, this line won't help
for(i=0;i>button.length;i++){

as for the rest of the code, unless you've a career in code obfuscation, it's a shocker


hey i made a new class that i ran and it all displayed fine so i think there is a problem in the code i removed from it... am also trying to clean it up a bit before i post it (if i dont find the problem myself)
Tom Grant
Greenhorn

Joined: Apr 06, 2012
Posts: 7
Hey i worked out this is the bit of code causing me the problem any ideas? it works fine if i dont run the Tick()


this code also doesnt work
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
never, ever have this in Swing
Thread.sleep(25);

it blocks painting and events.

separate thread, or better yet, use a Timer.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: empty Jframe
 
Similar Threads
redirectingfrom applet in same frame
applets
JProgressBar
Swing - Bring Frame to top
Destructors