IT Community - Software Programming, Web Development and Technical Support

how can i disable the title bar in JInternalFrame

This is a discussion on how can i disable the title bar in JInternalFrame within the Java Programming forums, part of the Software Development category; can anyone say me, how can i hide or remove the title bar in JInternalFrame?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Java Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-20-2008, 05:26 AM
saravanan saravanan is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Posts: 181
saravanan is on a distinguished road
Default how can i disable the title bar in JInternalFrame

can anyone say me, how can i hide or remove the title bar in JInternalFrame?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-26-2008, 01:25 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 322
amansundar is on a distinguished road
Default Re: how can i disable the title bar in JInternalFrame

title bar is actually a north pane which is an instance
of a BasicInternalFrameTitlePane. Setting this north pane to a null
value will remove the title bar from a JInternalFrame.


The following Java program demonstrates how to remove the title bar:

Code:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;


public class Frame_Without_Titlebar
extends JFrame {


public Frame_Without_Titlebar() {
super("InternalFrame Without TitleBar");


JInternalFrame frame = new JInternalFrame();


// Get the titlebar and set it to null
setRootPaneCheckingEnabled(false);
javax.swing.plaf.InternalFrameUI ui
= frame.getUI();
((javax.swing.plaf.basic.BasicInternalFrameUI)ui).setNorthPane(null);
 


frame.setBounds(30,30,200,200);
frame.setVisible(true);


JDesktopPane desktop = new JDesktopPane();
desktop.add(frame);
setContentPane(desktop);
}


public static void main(String[] args)
{
Frame_Without_Titlebar frame = new
Frame_Without_Titlebar();
frame.setBounds(30,30,300,300);
frame.setVisible(true);
}
}
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-26-2008, 02:43 AM
saravanan saravanan is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Posts: 181
saravanan is on a distinguished road
Default Re: how can i disable the title bar in JInternalFrame

thanks sundar i have been searching for this one since last month. i have checked this and its working well.
and say me an another one, now i am doing an application for intranet with more than 15 system. which is best for distributed application rmi application or java web application.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-26-2008, 02:47 AM
saravanan saravanan is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Posts: 181
saravanan is on a distinguished road
Default Re: how can i disable the title bar in JInternalFrame

Quote:
Originally Posted by amansundar View Post
title bar is actually a north pane which is an instance
of a BasicInternalFrameTitlePane. Setting this north pane to a null
value will remove the title bar from a JInternalFrame.


The following Java program demonstrates how to remove the title bar:

Code:
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;


public class Frame_Without_Titlebar
extends JFrame {


public Frame_Without_Titlebar() {
super("InternalFrame Without TitleBar");


JInternalFrame frame = new JInternalFrame();


// Get the titlebar and set it to null
setRootPaneCheckingEnabled(false);
javax.swing.plaf.InternalFrameUI ui
= frame.getUI();
((javax.swing.plaf.basic.BasicInternalFrameUI)ui).setNorthPane(null);
 


frame.setBounds(30,30,200,200);
frame.setVisible(true);


JDesktopPane desktop = new JDesktopPane();
desktop.add(frame);
setContentPane(desktop);
}


public static void main(String[] args)
{
Frame_Without_Titlebar frame = new
Frame_Without_Titlebar();
frame.setBounds(30,30,300,300);
frame.setVisible(true);
}
}
hai sundar!
i hope you know this well. i need to display an close button on top of the tab pane when i click the button the tab pane must be close. like some IDE s.
i need to create application with multiple window under a single window.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-26-2008, 04:37 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 322
amansundar is on a distinguished road
Default Re: how can i disable the title bar in JInternalFrame

Quote:

now i am doing an application for intranet with more than 15 system. which is best for distributed application rmi application or java web application.
AFAIK RMI-based applications enables you to create virtually transparent, distributed services and applications...

Quote:
i need to display an close button on top of the tab pane when i click the button the tab pane must be close. like some IDE s.
With the JTabbedPane class, you can achieve this, If you want similar functionality without the tab interface, you can use a card layout instead of a tabbed pane.

Code:
        JTabbedPane tabbedPane = new JTabbedPane();
        ImageIcon icon = createImageIcon("image.gif");

      JComponent panel1 = makeTextPanel("Panel #1");
tabbedPane.addTab("Tab 1", icon, panel1,
                  "Does nothing");
tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
above code help you implementing tabbedpane..
To switch to a specific tab, the user clicks it with the mouse or just press Alt-1.
here in the above code setMnemonicAt(0, KeyEvent.VK_1)
makes '1' the mnemonic for the respective tab hence by pressing Alt-1 makes the tab's component appear.apply the above code in ur application and set this for appearing new window (requirement for your application)...hope this would help you ....

To switch to a specific tab programmatically, use the setSelectedIndex or the setSelectedComponent methods.
__________________
cheers
Aman

Last edited by amansundar : 03-26-2008 at 05:01 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-27-2008, 06:24 AM
saravanan saravanan is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Posts: 181
saravanan is on a distinguished road
Default Re: how can i disable the title bar in JInternalFrame

Quote:
Originally Posted by amansundar View Post
AFAIK RMI-based applications enables you to create virtually transparent, distributed services and applications...



With the JTabbedPane class, you can achieve this, If you want similar functionality without the tab interface, you can use a card layout instead of a tabbed pane.

Code:
        JTabbedPane tabbedPane = new JTabbedPane();
        ImageIcon icon = createImageIcon("image.gif");

      JComponent panel1 = makeTextPanel("Panel #1");
tabbedPane.addTab("Tab 1", icon, panel1,
                  "Does nothing");
tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
above code help you implementing tabbedpane..
To switch to a specific tab, the user clicks it with the mouse or just press Alt-1.
here in the above code setMnemonicAt(0, KeyEvent.VK_1)
makes '1' the mnemonic for the respective tab hence by pressing Alt-1 makes the tab's component appear.apply the above code in ur application and set this for appearing new window (requirement for your application)...hope this would help you ....

To switch to a specific tab programmatically, use the setSelectedIndex or the setSelectedComponent methods.
Thanks you very much. i will try this.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-28-2008, 04:39 AM
saravanan saravanan is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Posts: 181
saravanan is on a distinguished road
Default Re: how can i disable the title bar in JInternalFrame

hai amansundar!

again this is kamal. you have just created a tab with an image. i need to add a close button on the tab. if i click the close button the tab must be close. and when i select an menu option that shows me the tab again. please find a way for me.

Thanks
kamal
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-28-2008, 05:33 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 322
amansundar is on a distinguished road
Default Re: how can i disable the title bar in JInternalFrame

may i know what your caring of?may you relying a good deal on me..
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change another window's title, that is, the content of title bar at the top itbarota HTML, CSS and Javascript Coding Techniques 1 09-13-2007 02:02 AM
How to give bug title & bug description fo ODD division? devarajan.v Quality Engineering and Methodologies 1 07-26-2007 11:14 PM
How to Dynamically Setting the Page's Title in ASP.NET 2.0? Archer C# Programming 1 07-23-2007 11:35 PM
Title Tag Optimization Tips vadivelanvaidyanathan Search Engine Optimization 0 03-30-2007 01:58 AM
SEO Optimization - Page Title drecko Search Engine Optimization 2 02-19-2007 12:28 AM


All times are GMT -7. The time now is 04:40 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0