• 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

MY Logo on JDailog

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,

Can somebody tell me, how to put a logo(Image) on a JDialog with its title name. Here is my code i want to put a logo(Image) before the title name of my dialog viz is ("my dialog")... plzzz can any body help me out.

public void Dialog2()
{
JDialog dialog = new JDialog(frame);
dialog.setTitle("my dialog");
dialog.setModal(true);
dialog.setResizable(false);

JPanel passPanel = getPassPanel();
dialog.add(passPanel, BorderLayout.NORTH);

JPanel buttonsPanel = getButtonsPanel();
dialog.add(buttonsPanel, BorderLayout.CENTER);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
dialog.setSize(300,130);
dialog.setVisible(true);
dialog.setLocationRelativeTo(frame);
}


Thanks in advance

Karan Galhotra
 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use

setIconImage(Image)

to get your task done
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't put an image in the title - it's text only. You'll need to find space for it in the dialog itself.
 
reply
    Bookmark Topic Watch Topic
  • New Topic