Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Where can I find Java 1.5 swing (JTabbedPane class) source code

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 21-07-2010
Member
 
Join Date: Apr 2010
Posts: 80
Where can I find Java 1.5 swing (JTabbedPane class) source code
  

I want to create a small drawing program. May is newbie I still quite advanced and I made a small thing to ask. In fact I will wish to have multiple tab to be able to have different areas of designs. So I think I should create a class that would do the setup in my JTabbedPane Listener and then create a new object of my class JTabbedPane Please note however , but I wonder how to make such as when I change the background color , this is done depends other. Thank you in advance.

Reply With Quote
  #2  
Old 21-07-2010
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Where can I find Java 1.5 swing (JTabbedPane class) source code

The JTabbedPane can have a container that contains other containers , the navigation between these various containers being from the tabs . The navigation tabs can be positioned left , top right or bottom . We found here a JTabbedPane with tabs and lockable code.
* A tab is a JComponent (Usually JPanel)
* A tab has
# title
# icon
# a ToolTipText
# an index in the list of tabs
Reply With Quote
  #3  
Old 21-07-2010
Member
 
Join Date: May 2008
Posts: 2,293
Re: Where can I find Java 1.5 swing (JTabbedPane class) source code

The class encapsulates a set of javax.swing.JTabbedPane tabs . Each tab consists of a title, and possibly a component of an image. To use this component, you must:
* instantiate an object of type JTabbedPane
* create the component of each tab
* add each tab in JTabbedPane object using the method addTab ( ).
Reply With Quote
  #4  
Old 21-07-2010
Member
 
Join Date: May 2008
Posts: 2,384
Re: Where can I find Java 1.5 swing (JTabbedPane class) source code

As of JDK 1.4, it is possible to add a keyboard shortcut on each tab using the method setMnemonicAt ( ). This method takes two parameters : the index of the tab in question (the first starts at 0 ) and the associated key on the keyboard as a constant KeyEvent.VK_xxx . To use this shortcut , simply use the designated key parameter of the method with the Alt key.
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
  #5  
Old 21-07-2010
Member
 
Join Date: Nov 2005
Posts: 1,323
Re: Where can I find Java 1.5 swing (JTabbedPane class) source code

Add a listener with ' addChangeListener is a very good solution. Created a class listening ex .:

Code:
public class ChangeListener implements EcouteJTabbedPane
{
public void StateChanged ( ChangeEvent e)
{
/ / Code
System.out.println (" Change " ) ;
}
}

Caution must be importing javax.swing.event .* ;
Then create an instance of this class and add the listener :

Code:
EcouteJTabbedPane ecouteJTabbedPane EcouteJTabbedPane = new () ;

jtabbedPane.addChangeListener ( ecouteJTabbedPane );
Reply With Quote
  #6  
Old 23-07-2010
Member
 
Join Date: Feb 2010
Posts: 766
Re: Where can I find Java 1.5 swing (JTabbedPane class) source code

It's best that you create yourself even this object, not very hard , you made a JPanel in CardLayout , and you test if your JtabbedPane contains only one element, so yes, you put directly in the Jpanel. if I have understood you would like to add your JTabbedPane tab ds, If the case when I do a montab.Add ( uneTab ) , the tab is automatically up to date ... if this is not the case.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Where can I find Java 1.5 swing (JTabbedPane class) source code"
Thread Thread Starter Forum Replies Last Post
Where to download Java EE 5 sdk source code Lohitaksha Software Development 6 24-07-2010 01:02 AM
Java Source Code From Compiled Binary CLASS Files Layton Windows Software 4 20-03-2010 09:54 PM
Confused about JTabbedPane class Sonam Goenka Software Development 5 13-02-2010 02:20 PM
How to use Swing Timer class in java program? KALANI84 Software Development 4 25-01-2010 04:37 PM
How to hide source code in JAVA Jacek Software Development 4 11-05-2009 10:42 AM


All times are GMT +5.5. The time now is 04:33 AM.