• 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

doesn't show picture unless resize main Window

 
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there

i have another weird (at least for me) problem.

My program does not display picture unless i resize main window.

here is my actionListener event code:



and this is where i print label


Thanks for any help
 
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

ibrahim yener wrote:


Is that a method you wrote? in what class? what does it do?

It's difficult to even guess at your problem without a SSCCE <- link

In general, every time you add/remove components from an already realized Swing GUI you need to invoke revalidate(0 and repaint().

And since this is about GUIs I shall move it to where the GUI experts hang out.
 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Darryl
Thanks for reply.

Yes, the method named setPlayingCards i wrote.
Besides that method everything works fine as it should be.

I have added contentPane.revalidate(); after read your post but still doesn't work.

Sorry for bothering you guys but i am learning Java about a month for now and we didn't learned GUI(Swing/Awt) yet.
All we know is just Java basics but i want to learn Java ASAP

Anyway, let's turn back to my subject. Shortly revalidate(); didn't work.
 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a screen shot i just made by Photoshop
this is exactly what i want.
Untitled-1.jpg
[Thumbnail for Untitled-1.jpg]
Black Jack Result
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Darryl requested you to post your SSCCE and you post a screenshot? Wow!

Anyway, Darryl has already told you

In general, every time you add/remove components from an already realized Swing GUI you need to invoke revalidate(0 and repaint().



I doubt anyone can help you out beyond this unless your post your SSCCE (<-link; click) code

 
ibrahim yener
Ranch Hand
Posts: 202
Android PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay
i solved the problem. I change revalidate into repaint and whoola!!! problem solved.

Thanks everyone who read my post and esp. Darryl and Maneesh.
 
reply
    Bookmark Topic Watch Topic
  • New Topic