Results 1 to 6 of 6

Thread: Remove The Title Bar Of A JDialog

  1. #1
    Join Date
    Nov 2009
    Posts
    117

    Remove The Title Bar Of A JDialog

    Hello, recently I have started learning the java GUI programming and while writing some code about it, I have got the problem of writing code which will provide me the JDialog without the Title Bar. If anyone is having solution regarding it, then please provide me that. So, I can create a JDialog without the Title Bar in Java programming Language.

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Remove The Title Bar Of A JDialog

    Hello, I have search this on internet and not find any solution regarding your problem. When I was creating one application and got same problem not able to solve it. If anyone is having solution about it then please reply me about the same. So, I can also able to get the answer about it. I have checked on different books but not get the solution about it.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Remove The Title Bar Of A JDialog

    Hello, you must need to make use of the method below which will provide you the JDialog without any title bar. So, just make use of it and solve your problem.
    Code:
    Mondialogo.setUndecorated(true)
    And you need to check the Java Platform, Standard Edition 6API Specification which will also provide you some of the other additional features and method which can you make use for your purpose.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Remove The Title Bar Of A JDialog

    Hello, I have got some code on internet which will provide you the JDialog without the title bar. I have not used it and so you need to check it first.
    Code:
    javax.swing.*; 
    import java.awt.*; 
    import java.awt.event.*; 
    public application extends Window 
    { 
    private btn btn; 
    publicapplication() 
    { 
    super(new Frame()); 
    btn = new btn("Close"); 
    btn.addActionListener(new ActionListener() 
    { 
    public void actionPerformed(ActionEvent e) 
    {
     System.exit(0); 
    }
    }); 
    setLayout(new FlowLayout()); 
    add(btn); 
    Dimension dm = Toolkit.getDefaultToolkit().getdm(); 
    setBounds(80,90,400, 400); 
    } 
    public static void main(String[] args) 
    { 
    application().setVisible(true); 
    } 
    }

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    Re: Remove The Title Bar Of A JDialog

    Hello, I think that you must make use of the method of the dialog.setUndecorated(true) which will simply remove the title bar of the JDialog. But, if you remove the Close option by removing the Title bar user will not able to remove the Dialog box when it want in simple way. So, I will suggest you that you must make use of the dialog.setDefaultCloseOperation or a WindowListener to get better performance.

  6. #6
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Remove The Title Bar Of A JDialog

    Hello, for removing the Title bar of a JDialog you must need to use the method below:
    Code:
    Dialogboxname.setUndecorated(true)
    If you want to get more knowledge about the java then you must make use of the books below:
    • Effective Java Programming Language Guide By Joshua Bloch
    • Design Patterns: Elements of Reusable Object-Oriented Software By Erich Gamma; Richard Helm; Ralph Johnson; John Vlissides
    • Refactoring: Improving the Design of Existing Code By Martin Fowler; Kent Beck; John Brant; William Opdyke; Don Roberts

Similar Threads

  1. Replies: 2
    Last Post: 26-04-2010, 09:59 PM
  2. Remove 'Non Commercial Use' in Office title bar
    By channinga in forum Office Setup
    Replies: 2
    Last Post: 26-03-2010, 04:30 AM
  3. Remove Title Bar of a Frame in Java
    By rashmi_ay in forum Software Development
    Replies: 4
    Last Post: 30-11-2009, 12:57 PM
  4. How to remove a title form .mkv file
    By BYRNE in forum Windows Software
    Replies: 3
    Last Post: 15-05-2009, 12:07 PM
  5. Need to remove Safari 4 tabs from Mac title bar
    By Ananias in forum Operating Systems
    Replies: 3
    Last Post: 17-03-2009, 01:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,078,139.33759 seconds with 16 queries