Results 1 to 6 of 6

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

  1. #1
    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.

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

    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

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    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 ( ).

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    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.

  5. #5
    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 );

  6. #6
    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.

Similar Threads

  1. Where to download Java EE 5 sdk source code
    By Lohitaksha in forum Software Development
    Replies: 6
    Last Post: 24-07-2010, 12:02 AM
  2. Java Source Code From Compiled Binary CLASS Files
    By Layton in forum Windows Software
    Replies: 4
    Last Post: 20-03-2010, 08:54 PM
  3. Confused about JTabbedPane class
    By Sonam Goenka in forum Software Development
    Replies: 5
    Last Post: 13-02-2010, 02:20 PM
  4. How to use Swing Timer class in java program?
    By KALANI84 in forum Software Development
    Replies: 4
    Last Post: 25-01-2010, 04:37 PM
  5. How to hide source code in JAVA
    By Jacek in forum Software Development
    Replies: 4
    Last Post: 11-05-2009, 09:42 AM

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,711,613,475.44937 seconds with 17 queries