• 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
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

To remove close button form Jdialog?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDialog.setDefaultLookAndFeelDecorated(true);

Then i have got all the components and tried to remove.but still its not working.


public void removeMinMaxClose(Component comp)
{

System.out.println("inside"+ comp);
if(comp instanceof AbstractButton)
{
System.out.println("inside22"+ comp);
comp.getParent().remove(comp);

}
if(comp instanceof JButton)
{
System.out.println("inside22"+ comp);
comp.getParent().remove(comp);

}
if (comp instanceof Container)
{

Component[] comps = ((Container)comp).getComponents();
for(int x = 0, y = comps.length; x < y; x++)
{
System.out.println("container"+comps[x].getName());

removeMinMaxClose(comps[x]);
}
}
}

I have tried the above which i got from forum.Anyone please help.

Thanks
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

Use code tags to post codes.
 
Beware the other head of science - it bites! Nibble on this message:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!