Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Modal Dialog without java coffee cup icon.  RSS feed

 
Niraj Pendal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am developing an application using swing.

I am using confirmation Dialog box to ask for User confirmation.

JOptionPane.showConfirmDialog(this, "Are you sure want to delete?", "", JOptionPane.OK_CANCEL_OPTION);

Dialog box contains Java coffee icon on let left top corner(normal Java application icon).

In frame "frame.setUndecorated(true)" can solve my problem but how can I remove this icon from confirm dialogbox?

Please suggest me some solution. Provide me some code sample or any useful link.

Thanks in Advance.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

May be this link help you,


See the inner frame create in sample code.


http://www.javafaq.nu/java-bookpage-32-4.html

 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We had a similar thread a few weeks ago: http://www.coderanch.com/t/433536/Swing-AWT-SWT-JFace/java/change-java-icon-swing

Window has a method called setIconImage. By passing a custom image you can change the image.

Now to disable it, all you need to do is pass it an invalid image. We came up with two ways in the previous thread:

1) new ImageIcon("somethingthatwillneverbeavalidfile").getImage()

2) new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
 
Patel Chintan
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Niraj Pendal wrote:Hi,

I am developing an application using swing.

I am using confirmation Dialog box to ask for User confirmation.

JOptionPane.showConfirmDialog(this, "Are you sure want to delete?", "", JOptionPane.OK_CANCEL_OPTION);

Dialog box contains Java coffee icon on let left top corner(normal Java application icon).

In frame "frame.setUndecorated(true)" can solve my problem but how can I remove this icon from confirm dialogbox?

Please suggest me some solution. Provide me some code sample or any useful link.

Thanks in Advance.


Hi Niraj,
Visit this link:
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html
 
Niraj Pendal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob Prime,



Thanks a lot.

I tried and It works fine.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!