Home Discussion Discuss: Add and Remove Tab to a JTabbedPane Container

  • Tabs in tabsOanthata Kealeboga April 11, 2011 at 8:44 PM

    Hi... I know how to use tabs but now I want add a tab insyd a tab... the code I used is below //----- // // AdminOptions Panel // AdminOptions.addTab("Staff Registration", StaffRegitration); AdminOptions.addTab("Browser Updates", BrowserUpdates); AdminOptions.addTab("User Screen", UsersScreen);//UserScreen is of type JPanel AdminOptions.setOpaque(true); AdminOptions.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { } }); UsersScreen.addTab("Delete User", DeleteUser); UsersScreen.setOpaque(true); UsersScreen.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { } }); The error I get is below: Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0 at javax.swing.plaf.basic.BasicTabbedPaneUI.paintTabArea(Unknown Source) at javax.swing.plaf.basic.BasicTabbedPaneUI.paint(Unknown Source) at javax.swing.plaf.ComponentUI.update(Unknown Source) at javax.swing.JComponent.paintComponent(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintToOffscreen(Unknown Source) at javax.swing.BufferStrategyPaintManager.paint(Unknown Source) at javax.swing.RepaintManager.paint(Unknown Source) at javax.swing.JComponent._paintImmediately(Unknown Source) at javax.swing.JComponent.paintImmediately(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source) at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Thanx in advance

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Java-Tutorials

Add and Remove Tab to a JTabbedPane Container
Add and Remove Tab to a JTabbedPane Container  ...: This section shows you how to add a tab to the JTabbedPane container and how to remove tab from a JTabbedPane container.  In this section, you will learn 

Java-Tutorials

Creating a JTabbedPane Container in Java Swing
can also container component with the specific tab. add(): This is the method of JTabbedPane class which is used to add container component to the JTabbedPane... Creating a JTabbedPane Container in Java Swing   

Framework Questions

Tab Container
Tab Container  AM i going to have loading problems when i let the user to create an infinite number of tabs ??? btw am trying to create a single page application with multiple tabs (or panels 

Java-Tutorials

Set the Color of a Tab in a Tabbed Pane Container in Java
Set the Color of a Tab in a Tabbed Pane Container in Java... will learn how to set colors for a tab in a tabbed pane container in Java Swing applications. Every tab and it's corresponding container can have different colors 

Java-Tutorials

Java JTabbedPane Example
Java JTabbedPane Example In this section we will discuss about how to add the Tab pane in JFrame. javax.swing.JTabbedPane provides the feature to add tabs...(lab8); tp=new JTabbedPane(); Container pane 

Java Beginners

Jtabbedpane - Java Beginners
in JTabbedPane and interacting with user...); JTabbedPane tab = new JTabbedPane(); frame.add...(JFrame.EXIT_ON_CLOSE); JTabbedPane tab = new JTabbedPane(); frame.add(tab...Jtabbedpane  JTabbedPane and i have no idea how to intract 

Java Beginners

Remove Top-Level Container on Runtime
Remove Top-Level Container on Runtime  Remove Top-Level Container on Runtime 

Java Beginners

java JTabbedPane() - Java Beginners
java JTabbedPane()  how to add layout manager in JTabbedPane() plese...(new BorderLayout()); getContentPane().add(topPanel); // Create the tab pages... { private JTabbedPane tabbedPane; private JPanel panel1; private JPanel panel2 

Java Beginners

jtabbedpane
jtabbedpane  How to add jtextfield or jtabbedpane by coding using java netbeans?? plzz help 

Java-Tutorials

Enable and Disable Tab in Java
Enable and Disable Tab in Java   ... and disable any tab in a TabbedPane component of Java Swing. The tabbed pane container can have one or more tables. All the tabs have a specific area in same 

Framework Questions

how to change background color in dojo tab container - Framework
how to change background color in dojo tab container  how to change background color in dojo tab container 

Java Beginners

jtabbedpane
jtabbedpane  how to add a close button in jtabbed pane using java swing 

Java Beginners

JAVA SWING JTabbedPane - Java Beginners
about how to place a tab in JTabbedPane in the middle rather than from left..."); JTabbedPane tabbedPane = new JTabbedPane(); Component panel1..., "Now click get more title"); //Add the tabbed pane to this panel 

Programming Tutorials

Change the color of the selected tab
("TabbedPane.selected", Color.blue); JTabbedPane tab = new JTabbedPane(); frame.add...Change the color of the selected tab Swing provides different methods to give..., you will learn how to change the color of the selected tab. For this, we have 

Adobe Flex

Flex Tab Navigator example
Flex Tab Navigator example   ... is present and under this class TabNavigator container is present. Tab Navigators are Navigator containers of flex 

HTML Tutorial

Making Tab using Javascript
Making Tab using Javascript       This Example describes the way to make Tab...;thismenu.currentLink=links[0];   domtab.cssjs('add',links[0].parentNode 

Adobe Flex

TitleWindow layout container
TitleWindow layout container       TitleWindow container is much like panel container. It provides title bar, border, content area as panel container does. The added features 

Ajax Questions

container
container  how to add containers in form 

Programming Tutorials

Spark DataGroup Container in Flex4
;/s:Application> Add and Remove item in data provider...Spark DataGroup Container in Flex 4: DataGroup container is a Spark container... as children. These container uses item renderer that provide visual representation 

Programming Tutorials

Window Container in Flex4
Window Container in Flex4 : This container are use window applications in flex 4. Spark Window container is provide a way if user want to create own window. The Window container are provide layout and content of operating system window 

Programming Tutorials

Identify the use, syntax, and behavior of, the following entity bean home method types, for Container-Managed Persistence (CMP); finder methods, create methods, remove methods, and home me
bean home method types, for Container-Managed Persistence (CMP); finder methods, create methods, remove methods, and home methods.Prev ... types, for Container-Managed Persistence (CMP); finder methods, create 

Mobile Applications Questions

Iphone Tab Bar Controller
Iphone Tab Bar Controller  Hi, I am very new in mobile application programming. So, how can i create iphone tab bar controller apps. Please suggest me any online help, so that i will enhance my technical skill in mobile web 

Mobile Applications Questions

iphone tab bar
iphone tab bar  how to add tab bar items dynamically in iphone... be dynamicaaly added as tabs in the more tab. please can u provide any such code . .   the answer you provided is just the basic of tab bar control,i want 

Programming Tutorials

Access container and server services from enterprise components
Access container and server services...; Access container and server services from enterprise components... the Data source tab at the bottom of the editor 

Programming Tutorials

Chapter 6. Component Contract for Container-Managed Persistence (CMP)
Chapter 6. Component Contract for Container-Managed...     Chapter 6. Component Contract for Container-Managed... application An entity bean with container-managed 

Servlet Interview Questions

servlet container
servlet container  What is servlet container 

Java Beginners

Java container
Java container  What is a Container in a GUI 

Struts Questions

Remove history
Remove history  how to remove history in struts2 after clicking on logout link 

Java Interview Questions

java container
java container  Why the container does not support multiple layout managers 

Servlet Interview Questions

servlet container
servlet container  When a client request is sent to the servlet container, how does the container choose which servlet to invoke?   The servlet container determines which servlet to invoke based on the configuration 

DMCA.com