• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Closing dialog after JOptionPane.showInternalOptionDialog  RSS feed

 
Ranch Hand
Posts: 41
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best forum!

I have a JOptionPane.showInternalOptionDialog object with no buttons and as a message object it has a label which is of 600x600 pixels in size
My code to invoke the JOptionPane in question looks like this



So far everything works just fine. The label object that is registered as a message object in the JOptionPane has a MouseListener attached to it.
The user is suppose to close the JOptionPane object by clicking on the label it has as a message object but this is where the problems begins.
I would like to close the JInternalFrame or JDialog that is called by JOptionPane.showInternalOptionDialog after the user has clicked on
the CoverImageLabel object. This seems almost impossible to do since my JOptionPane doesn't have no close or cancel button. I have tried
this using the following method but everthing freezes up on the application itself:



Is it possible to accomplish what i am trying to do here? Any help or hint is greatly much appreciated. Apologizes
for any bad english or java  

Kind regards,
Robert!





 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try change



to


 
Robert Ingmarsson
Ranch Hand
Posts: 41
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the reply!

Thank you fo the provided code but I have solved the problem in question by using this method



The method doDefaultCloseAction(); in the JInternalFrame class did the job well! This thread is now solved.




Kind regards,
Robert

 
Marshal
Posts: 64179
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done

It is usual to use i++ rather than ++i or the increment part of your for loop.
 
It runs on an internal combustion engine. This ad does not:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!