Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 22nd, 2013, 01:14 PM
l11h l11h is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 1 l11h User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 58 sec
Reputation Power: 0
Swing - Get everything in JTabbedPane tabs in Center of page?

Hi,

I am new to Java programming, and I have created 4 classes which use GridBagLayout, I then created 1 final class which collates all the other classes to be shown as one class.

The problem is the GUI classes show the GUI in center of page, the tabbed version show the GUI in top center of page, I dont like the look of this.

I was wandering if there is a way that I can get the JTabbedPane GUI's in the middle?

Below i will post the code of the class that collates all the GUI's together.


import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;

public class main extends JFrame {


JTabbedPane tab = new JTabbedPane();
CustomerRegistration CR = new CustomerRegistration();
EquipmentHire EH = new EquipmentHire();
EquipmentRegistration ER = new EquipmentRegistration();

public main()
{
tab.add("Customer Registration", CR);
tab.add("Equipment Hire", EH);
tab.add("Equipment Registration", ER);
getContentPane().add(tab);
}

public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable(){
public void run(){
main m = new main();
m.setTitle("Test");
m.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
m.setSize(1280,720);
m.setLocationByPlatform(true);
m.setVisible(true);
}
});
}
}


ty for all your help

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Swing - Get everything in JTabbedPane tabs in Center of page?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap