Results 1 to 2 of 2
- 04-04-2011, 01:47 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 22
- Rep Power
- 0
In TabbedPane Diagrams do not appear
I wanted to create 2 tabs and on each tab should be four diagrams. The diagrams itself works fine on a single page, but now I need to distribute them, since they are too many. I tried the following thing, but it did not seem to work.
I do not get any error message - so it should work, but it does not? :confused: I assume something pretty fundamental is not working.Java Code:public JPanel createDemoPanel() { JFrame demoPanel = new JFrame("TabbedPaneDemo"); JTabbedPane tabbedPane = new JTabbedPane(); ImageIcon icon = new ImageIcon("Month01.gif"); JComponent panel1 = makeTextPanel("Panel #1"); tabbedPane.addTab("Tab 1", icon, panel1, "Does nothing"); tabbedPane.setMnemonicAt(0, KeyEvent.VK_1); JPanel demoPanel1 = new JPanel(new GridLayout(2, 2)); demoPanel1.add(new DemoPanelA()); demoPanel1.add(new DemoPanelB()); JComponent panel2 = makeTextPanel("Panel #2"); tabbedPane.addTab("Tab 1", icon, panel2, "Does nothing"); tabbedPane.setMnemonicAt(0, KeyEvent.VK_1); JPanel demoPanel2 = new JPanel(new GridLayout(2, 2)); demoPanel2.add(new DemoPanelE()); demoPanel2.add(new DemoPanelF()); return demoPanel1; } protected JComponent makeTextPanel(String text) { JPanel panel = new JPanel(false); JLabel filler = new JLabel(text); filler.setHorizontalAlignment(JLabel.CENTER); panel.setLayout(new GridLayout(1, 1)); panel.add(filler); return panel; }
I would appreciate any hint - Thanks for your support.
-
Similar Threads
-
drag and drop for diagrams - help!
By zoz in forum AWT / SwingReplies: 10Last Post: 12-20-2009, 07:59 PM -
Exporting UML diagrams to MS Visio
By lettyh in forum NetBeansReplies: 0Last Post: 10-30-2008, 06:19 PM -
Another Color TabbedPane Example
By Java Tip in forum javax.swingReplies: 0Last Post: 06-26-2008, 07:37 PM -
Eclipse plugin for UML diagrams
By nitingupta183 in forum EclipseReplies: 3Last Post: 03-26-2008, 11:08 AM -
Help with tabbedpane
By carl in forum AWT / SwingReplies: 1Last Post: 08-07-2007, 07:06 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks