• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

empty Jframe

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Tom Grant
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?

 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Tom Grant
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 :
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> 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
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
never, ever have this in Swing
Thread.sleep(25);

it blocks painting and events.

separate thread, or better yet, use a Timer.
 
reply
    Bookmark Topic Watch Topic
  • New Topic