Good book on Layout Managers...

Hi,
I am looking for good book on Swing. I needed to be a lot of things: a good reference, good explanations, good explanation about how Layout managers work and how to design GUIs.
One of the biggest problems that I am having is, I think, not understanding how to layout my components and how to control each component so that the GUI doesn't look rediculous. So, I need a general explanation as well as a detailed, all in one.
Does anyone know of a book or a set of books that would do this?
Thanks,
Yaakov.

Core JFC (2nd Edition) by Kim Topely has a good section on gridbag. I really like this book. For more current books, try Java Swing, Second Edition by James Elliot et al and Swing, Second Edition by Matthew Robinson et al.
As for layout managers, we've been using RelativeLayout and are very happy with it. Coding it is rather wordy and tedious, but it makes a lot more sense to us than gridbag's wacky concepts (weights, invisible grids with insets etc). I find it much more precise for positioning components than gridbag. Our new Swing programmers understand RelativeLayout within about 10 minutes of messing with it.
Read about (and obtain) RelativeLayout at:
http://www.onjava.com/pub/a/onjava/2002/09/18/relativelayout.html
and
http://www.onjava.com/pub/a/onjava/2002/11/27/layout2.html
Michael Billesbach

Similar Messages

  • Newbie help: Layout Managers

    Hi,
    as a newbie in Swing I have difficulties with the Layout Managers... I have read the Swing tutorial but it's still a little bit complicated:
    I have a JPanel, I would like to add a JMenuBar, a JToolbar and then 2 additional JPanels at the top and on the left representing rulers like in the "How a Scroll Pane Works" example at
    http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html as well as a JTable on the right.
    How can I do this... BorderLayout containing my main JPanel at CENTER and the two JPanels representing the rulers at PAGE_START and LINE_START and the JTable at LINE_END? Where can I place then my menu- and toolbar? Can I add a BoxLayout to PAGE_START for that?
    In a posting here at the forum I read that the MenuBar should be added to the root Pane. How do I do this? When do I use Content Pane, Layered Pane and Glass Pane?
    Do you know a simple example or good tutorials at the web?
    Thanks a lot!

    Thank you for the link about the rulers.
    The rulers goes inside your custom component. It will be like the example at http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html
    Other stuffs layered like this.
    package tmp;
    import javax.swing.*;
    import java.awt.*;
    public class LayoutExample extends JFrame
        public static void main( String[] args ) throws Exception
            SwingUtilities.invokeAndWait( new Runnable()
                public void run()
                    // All the interaction with GUI do inside the MessageLoop thread!
                    LayoutExample l = new LayoutExample();
                    l.pack();
                    l.setVisible( true );
        protected JMenuBar mainMenu;
        protected JToolBar mainToolBar;
        protected RulesFeaturedScrolPane scrollPane;
        public LayoutExample() throws HeadlessException
            super();
            setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
            setTitle( "Layout Example" );
            // -------------- CREATING NECESSARY CONTROLS ----------------
            // Menu
            mainMenu = new JMenuBar();
            JMenu mnuFile = mainMenu.add( new JMenu( "File" ) );
            mnuFile.add( new JMenuItem( "Open" ) );
            // ToolBar
            mainToolBar = new JToolBar();
            mainToolBar.add( new JButton( "Open" ) );
            // Customized JScrollPane (with rulers)
            scrollPane = new RulesFeaturedScrolPane();
            // -------------- END OF CREATING NECESSARY CONTROLS ----------------
            // Settig up the components
            setJMenuBar( mainMenu ); // Menu added to JFrame not to its ContentPane
            getContentPane().setLayout( new BorderLayout() );
            getContentPane().add( mainToolBar, BorderLayout.NORTH ); // ToolBar added to the ContentPane
            getContentPane().add( scrollPane, BorderLayout.CENTER ); // Other components added to ContentPane
        public static class RulesFeaturedScrolPane extends JPanel // <----------- this may extend JScrollPane
            public RulesFeaturedScrolPane()
                add( new JLabel( "TODO: this class should have rulers" ) );
    }Most interesting things starts at getContentPane().setLayout( new BorderLayout() );

  • How to make fixed width size on grid layout managers.,

    hiya,
    my gird contains labels but whenever the labels has different width on their texts, the grid adopts to the width of the text, how not to?
    many thanks! :)

    Thats the way the GridLayout works, each cell is the same size. The size is determined by the largest component added to the grid.
    Here is the Swing tutorial on "Using Layout Managers".
    http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html

  • Suggestion on Good Books for SAP NetWeaver Administrator

    Hi,
    I am very new to SAP NetWeaver. Can any one please suggest some good books to learn SAP NetWeaver Administration. Is SAP NetWeaver For Dummies is good book to start with?
    I want to understand the SAP NetWeaver Architecture and also want to learn from SAP Basis administration/Consultant point of view. So which book can help?
    Also I got to kmow, SAP NetWeaver includes the following components and tools:
    Components:
    SAP Auto-ID Infrastructure
    SAP Business Intelligence
    SAP Enterprise Portal
    SAP Exchange Infrastructure
    SAP Master Data Management
    SAP Mobile Infrastructure
    SAP Web Application Server
    Tools
    SAP Composite Application Framework
    SAP NetWeaver Developer Studio
    SAP Solution Manager
    So from SAP Basis Consultant point of view, which Componet one should learn or focus on?
    Appreciate help.
    Thanks
    Regards,
    BasisCK.

    Hi Nitin,
    Thanks for the reply. SAP R/3 Handbook, Third Edition - By Jose Antonio Hernandez, Franklin Martinez, James Keogh
    ~
    Table of contents
    Chapter 1: SAP: From SAP R/3 to SAP NetWeaver
    Chapter 2: The Architecture of the SAP Web Application Server
    Chapter 3: SAP NetWeaver: An Overview
    Chapter 4: Using SAP Systems
    Chapter 5: Upgrading to SAP R/3 Enterprise: The First Step into SAP NetWeaver
    Chapter 6: The Change and Transport System
    Chapter 7: Development Options with SAP Solutions: ABAP Engine
    Chapter 8: User Management and Security in SAP Environments
    Chapter 9: Web Application Server System Management
    Chapter 10: Performance and Troubleshooting with SAP Solutions
    Chapter 11: SAP for IT Managers: Implementation, Planning, Operation, and Support of SAP Systems
    INDEX
    ~
    Is this book completely talk about SAP NetWeaver or it's kind of transition/bridge from SAP R/3 to SAP netweaver?
    Since you are experienced in Netweaver technology, can you suggest the step by step approach to be master in this?
    I mean read this book first, then what next? what component I should go for it? XI, EP??
    Appreciate your help and inputs.
    God bless u.
    Thx
    Regards.
    Basis CK.

  • Heavy Fog - Layout Managers and the word "preferred"

    Hello again world.
    While reading the API, the tutorials, and various other documentation dealing with layout managers, I keep coming across the word "preferred" - "preferred size", "preferred width", "preferred height", and so on.
    However, I can't seem to visualize just what "preferred" means in this context.
    Do they pre-suppose that one has used the setPreferredSize() method?
    And if no set*Size() method is used, how does the parent container size its components? The literature just comes back to "preferred" this and that.
    This whole "preferred" business is, to me, circular and confusing, and the more I read, the foggier things get.
    Anyone out there with a fresh breeze?
    Thank you one and all.
    Ciao for now.

    You should never use setSize(). The size of a component is set by the LayoutManager as the components in the container are layed out. For example say you are using a GridLayout and you have 3 buttons: following text:
    small = new JButton("small");
    medium = new JButton("medium sized");
    large = new JButton("the largest button");
    The preferred size of each button is calculated to be:
    a) the size of the text +
    b) the border +
    c) the margin
    When components are added to the GridLayout all components are made the same size. The preferredSize does not change, but the size of each button is set the the largest preferredSize of the three buttons before it is painted. The GridLayout ignores the preferredSize of individual components and only cares about the largest component.
    On the other hand the FlowLayout repects the preferredSize of each component when they are layed out and painted. When using a FlowLayout you can set the preferredSize of each component to be the same by doing the following:
    small.setPreferredSize( large.getPreferredSize() );
    medium.setPreferredSize( large.getPreferredSize() );
    Every LayoutManager has rules it follows with respect to preferredSize, minimumSize and maximumSize. Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]Using Layout Managers.

  • How to use layout managers

    Hi ,
    I designed a JFrame. If i enlrged the frame widow, the components are not arranged properly. How can i arrange them.
    narayana

    the components are not arranged properly.That statement mean absolutely nothing. They are arranged properly according the to the rules of the Layout Manager you are using.
    If it is not layed out the way you want then you need to use a different Layout Manager or combination of Layout Managers. Since you don't define what "properly" means you are on your own.
    Read the tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use Layout Managers

  • Learning how to use Layout Managers

    The code that is included in this post is public code from the SUN tutorials. I am trying to learn how to use the layouts and add individual programs that were created to each component in the layouts.
    This is what I am exploring:
    I want to have a tabbed layout like the example TabbedPaneDemo located at http://java.sun.com/docs/books/tutorial/uiswing/examples/components/index.html#TabbedPaneDemo. Below is the code.
    In one of the tabs, I want to place a button and report in it. When the button is clicked, I want the report refreshed. Eventually I will be populating an array with data. The report I want to use the example SimpleTableDemo located at http://java.sun.com/docs/books/tutorial/uiswing/examples/components/SimpleTableDemoProject/src/components/SimpleTableDemo.java. Below is the code.
    From what I have learned, you can place a container inside a container. So I should be able to place the SimpleTableDemo inside the tab 4 of the TabbedPaneDemo.
    If this is indeed correct, then how do I put these two things together? I am getting a little lost in all the code.
    Any assistance in helping me learn how to create and use layout managers would be appreciated.
    package components;
    * TabbedPaneDemo.java requires one additional file:
    *   images/middle.gif.
    import javax.swing.JTabbedPane;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JComponent;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.KeyEvent;
    public class TabbedPaneDemo extends JPanel {
        public TabbedPaneDemo() {
            super(new GridLayout(1, 1));
            JTabbedPane tabbedPane = new JTabbedPane();
            ImageIcon icon = createImageIcon("images/middle.gif");
            JComponent panel1 = makeTextPanel("Panel #1");
            tabbedPane.addTab("Tab 1", icon, panel1,
                    "Does nothing");
            tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
            JComponent panel2 = makeTextPanel("Panel #2");
            tabbedPane.addTab("Tab 2", icon, panel2,
                    "Does twice as much nothing");
            tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
            JComponent panel3 = makeTextPanel("Panel #3");
            tabbedPane.addTab("Tab 3", icon, panel3,
                    "Still does nothing");
            tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);
            JComponent panel4 = makeTextPanel(
                    "Panel #4 (has a preferred size of 410 x 50).");
            panel4.setPreferredSize(new Dimension(410, 50));
            tabbedPane.addTab("Tab 4", icon, panel4,
                    "Does nothing at all");
            tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);
            //Add the tabbed pane to this panel.
            add(tabbedPane);
            //The following line enables to use scrolling tabs.
            tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        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;
        /** Returns an ImageIcon, or null if the path was invalid. */
        protected static ImageIcon createImageIcon(String path) {
            java.net.URL imgURL = TabbedPaneDemo.class.getResource(path);
            if (imgURL != null) {
                return new ImageIcon(imgURL);
            } else {
                System.err.println("Couldn't find file: " + path);
                return null;
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from
         * the event dispatch thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("TabbedPaneDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Add content to the window.
            frame.add(new TabbedPaneDemo(), BorderLayout.CENTER);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event dispatch thread:
            //creating and showing this application's GUI.
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    //Turn off metal's use of bold fonts
              UIManager.put("swing.boldMetal", Boolean.FALSE);
              createAndShowGUI();
    package components;
    * SimpleTableDemo.java requires no other files.
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    public class SimpleTableDemo extends JPanel {
        private boolean DEBUG = false;
        public SimpleTableDemo() {
            super(new GridLayout(1,0));
            String[] columnNames = {"First Name",
                                    "Last Name",
                                    "Sport",
                                    "# of Years",
                                    "Vegetarian"};
            Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true)},
                {"Kathy", "Walrath",
                 "Knitting", new Integer(2), new Boolean(false)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true)},
                {"Philip", "Milne",
                 "Pool", new Integer(10), new Boolean(false)}
            final JTable table = new JTable(data, columnNames);
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            table.setFillsViewportHeight(true);
            if (DEBUG) {
                table.addMouseListener(new MouseAdapter() {
                    public void mouseClicked(MouseEvent e) {
                        printDebugData(table);
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Add the scroll pane to this panel.
            add(scrollPane);
        private void printDebugData(JTable table) {
            int numRows = table.getRowCount();
            int numCols = table.getColumnCount();
            javax.swing.table.TableModel model = table.getModel();
            System.out.println("Value of data: ");
            for (int i=0; i < numRows; i++) {
                System.out.print("    row " + i + ":");
                for (int j=0; j < numCols; j++) {
                    System.out.print("  " + model.getValueAt(i, j));
                System.out.println();
            System.out.println("--------------------------");
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("SimpleTableDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            SimpleTableDemo newContentPane = new SimpleTableDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    Before I did what you suggested, which I appreciate your input, I wanted to run the code first.
    I tried to run the SimpleTableDemo and received the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: SimpleTableDemo (wrong name: componets/SimpleTableDemo)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader...
    there are several more lines but as I was typing them out I thought that maybe the code is not written to run it in the command window. The errors seem to be around the ClassLoader. Is that correct? On the SUN example page when you launch the program a Java Web Start runs. So does this mean that the code is designed to only run in WebStart?

  • Suggestion for a good book for webdynpro for java

    Hi, I am new to this technology,and i know a little bit basics,but i want to learn in depth regarding Webdynpro For Java and my backend is SAP R/3
             can anyone suggest me  a good book for webdynpro for java

    Hi padma,
    Check this link.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#9">Web Dynpro Sample Applications and Tutorials</a>
    Re: Guides for new entrant to Webdynpro
    Regards,
    Mithu

  • Suggestion for a Good Book

    Hi,
    Could someone suggest me a good book covering core java security (not J2EE)?. I'm looking for a book that covers all security related APIs that are part of Java 2 SDK 1.3.x + JSSE + JCE + JAAS or Java 2 SDK 1.4.x.
    Any help would be highly appreciated.
    Thanks.

    I've a book called "Professional Java Security",
    by Jess Garms and Daneil Somerfield, published by Wrox press.
    I've used it to dip my toes into the Java Cryptography extension, and
    it was very good. I got a TripleDES encryption utility working reasonably easy.
    Also covers JCA, JCE, JAAS, JSSE, SSL and E-Commerce.
    regards,
    Owen

  • GW 6.5 - A suggestion for a good book

    Hello people !
    I'm CNE in Brazil and I would like to know a good book to implement GroupWise 6.5.1 im my server that it will work with Border Manager 6.5 SP3 (Small Business Suite Starter Pack).
    Thanks in advance.

    These fourms are focused on developer issues, you will find that Novell has a
    different set of forums for general support, which have a lot more people answering
    questions.
    Say that take a look at Novell's own book
    http://www.novell.com/training/books...=bookAdm&val=3
    Roger Thomas, Dev SysOp 22
    <[email protected]> wrote in message news:Ovy4e.3095$[email protected]..
    Hello people !
    I'm CNE in Brazil and I would like to know a good book to implement GroupWise 6.5.1 im my server that it will work with Border Manager 6.5 SP3 (Small Business Suite Starter Pack).
    Thanks in advance.

  • What's a good book for getting started?

    I've been doing web design in HTML and ColdFusion for almost 3 years. It's clear that ColdFusion is on it's way out and I need to learn J2EE/Java/JSP etc. I have a few questions:
    Java is a term I've heard associated with C++ and other types of programming as well as Web design. Are the Java/C++ Java and the Web Java basically the same type of language? Is the Web Java and JavaScript the same thing? I'm very confused!
    What is a good book for getting these types of questions answered and getting started in J2EE/Java/JSP? There are quite a few variations of script languages out there and I want to make sure I learn the right stuff, ie the stuff that employers are going to be needing.
    Thanks!

    Here is a free online version of a good book:
    http://pdf.coreservlets.com/Core-Servlets-and-JSP.pdf
    Print it off or read from the screen. Otherwise, there are several good Java books out there. What I would do is go to the bookstore and thumb through a few books. Depending on what type of book you want (example based or theory) find the books that you think would satisfy your learning style. Write down the names and authors, go home and buy them used online at Amazon for tremendous discounts. This way you can buy several versus just one.

  • Address book - labels layout - other formats

    Hello Forum
    Does anyone know of a collection of other layouts for the address book label layouts. At the moment I only see Avery std, Avery A4 and DYMO.
    There's a whole set of labels of other label makers eg DECAdry that I don't find in the list. Nor do I know of (or find) a site that maps DECAdry on Avery equivalents.
    I can of course simply add it as custom layout but I was wondering if there were other alternatives?

    Mike,
    you might wish to give AB Transfer a try:
    http://www.turingart.com/abtlan_en.htm
    It is a solution to import, export or convert AB data.
    Regards,
    seaside

  • Please recomend a good book to create art in Photoshop?

    I want to learn to create menus and artwork in photoshop and Illustrator.
    I have seen many books but they tend to work with manipulating photographs.
    I want to create pictures and menus....
    Can anyone recommend a good book (available in UK) to teach me steps in either illustrator or photoshop.
    Thank you
    Terry

    I know 2 books there are initial and advanced concepts of visual composer
    Get all basic step and some advanced steps, its very good book.
    http://www.sap-press.com/product.cfm?account=&product=H1932
    This books have a basic concetps, but there are concepts of other tecnologies about NWCE.
    Its good book to, but to VC i the first one is better.
    http://www.sap-press.com/product.cfm?account=&product=H2920
    All best
    Marcos

  • How to get a specific layout with the available layout managers?

    Hi
    Not done java GUI's (approximately 5 and a half years) for a while (I havn't even touched java for ages until a few months ago), and I am a little embarrased by how much I have forgotten.
    After tring unsuccessfully several times with TableLayouts and GridBagLayouts to produce this [ [http://i32.tinypic.com/fl94kp.png] ] sort of layout, I have decided I am either being incredibly stupid, or It's a rather difficult thing to do.
    (Sorry about the crudeness of the drawing)
    Please can someone point me on the right track as to what combination of layout managers + components I should be using to achive this, or even be super kind and post a code snippet for it.
    Preferably, I would like to use just the default layout manages / components that come with java, which will allow me to continue working on the GUI in netbeans without it complaining, but I'll use external libraries if absolutely nesecarry.
    Thanks
    A completely unrelated side note, but where the heck have all my past posts and dukes gone. :(
    Edited by: DarthCrap on Aug 2, 2010 5:14 PM

    Yes, A BorderLayout did solve my problems. It appears I was being stupid after all. :)
    @Encephalopathic. Using a gridbaglayout does indeed help with the centering issue for the smaller panel on the right. I had just worked that out myself when you posted. I had been reluctant to try the gridbaglayout for that, because it caused me a load of pain when I tried using it for the original problem.
    Thanks

  • Layout managers and JTabbedPane

    I have a JTabbed pane on my 'form' on which i want to insert two tables. the problem is that the tables are overstepping the 'boundaries' i have desgned for them ,whivh i suspect is a problem with the layout managers. I just cant seem to be able to restrict the tables within the fames and have scrollpanes, both horizontal and vertical for scrolling tables. I have included the code here:
    import java.awt.*;
    import javax.swing.*;
    public class FrmProducts extends JFrame{
         private          JTabbedPane tabbedPane;
         private          JPanel          factorsTab;
         private          JPanel          productListTab;
         private          JPanel          rateHistoryTab;
         private          JTable          forexFactorsTable;
         private          JTable      otherFactorsTable;
         private      JTable          productListTable;
         public FrmProducts(){
              initializeComponents();
         public  void DisplayForm(){
              java.awt.EventQueue.invokeLater(new Runnable(){
                   public void run(){
         private void initializeComponents(){
              setTitle( "Products administration" );
              setSize( 900, 550 );
              setBackground( Color.gray );
              JPanel topPanel = new JPanel();
              topPanel.setLayout( new BorderLayout() );
              getContentPane().add( topPanel );
              Toolkit kit = getToolkit();
              Dimension screenSize = kit.getScreenSize();
              int screenWidth = screenSize.width;                         //all this is to get
              int screenHeight = screenSize.height;                    //the form size and
              Dimension windowSize = getSize();                       //centre the form on
              int windowWidth = windowSize.width;                         //the screen
              int windowHeight = windowSize.height;
              int upperLeftX = (screenWidth - windowWidth)/2;
              int upperLeftY = (screenHeight - windowHeight)/2;
              setLocation(upperLeftX, upperLeftY);
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              // Create the tab pages
              createPage1();
              createPage2();
              createPage3();
              // Create a tabbed pane
              tabbedPane = new JTabbedPane();
              tabbedPane.addTab( "Facors", factorsTab );
              tabbedPane.addTab( "Products List", productListTab );
              tabbedPane.addTab( "Rate History", rateHistoryTab );
              topPanel.add( tabbedPane, BorderLayout.CENTER );
              setVisible(true);
         public void createPage1()
              factorsTab = new JPanel();
              factorsTab.setLayout( new GridLayout(2,1) );
              JPanel forexFactorsPanel;          //set up a frame with the forex factors details
              forexFactorsPanel = new JPanel();
              forexFactorsPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Forex factors"),
                BorderFactory.createEmptyBorder(5,5,5,5)));
              String forexFactorsColumns[]={"Factor","ZAR","US$"};
              String dummyValues1[][]={ {"Costing exchange rate","485.00",   "3400.00"},
                                          {"Local product exchange rate","430.00","3000.00"},
                                          {"Duty exchange rate1","35.30",          "250.00"},
                                          {"Duty exchange rate2","35.30",          "250.00"}};
              forexFactorsTable=new JTable(dummyValues1,forexFactorsColumns);
              JScrollPane scrollPane1=new JScrollPane(forexFactorsTable);
              forexFactorsPanel.add( scrollPane1, BorderLayout.CENTER );
              factorsTab.add(forexFactorsPanel);
              JPanel otherFactorsPanel;
              otherFactorsPanel=new JPanel();
              otherFactorsPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Other factors"),
                     BorderFactory.createEmptyBorder(5,5,5,5)));
              String otherFactorsColumns[]={"Description","Value"};
              String dummyValues2[][]={{"Landing Factor",                         "1.16"},
                                            {"Duty factor",                        "1.065"},
                                            {"Loading for overseas sourcing",  "1.15"},
                                            {"Extra mark up local",             "0.0"},
                                            {"Extra mark up imports",          "0.0"}};
              otherFactorsTable=new JTable(dummyValues2,otherFactorsColumns);
              JScrollPane scrollPane2=new JScrollPane(otherFactorsTable);
              otherFactorsPanel.add(scrollPane2, BorderLayout.CENTER);
              factorsTab.add(otherFactorsPanel);
         public void createPage2()
              productListTab = new JPanel();
              productListTab.setLayout( new BorderLayout() );
              String productListColumns[]={"Code1","Code2","Code3","Sales Category","Product code","Short Description",
                                             "Long Description","Supplier/Manufacturer","Supplier Product code",
                                             "Units","Master stockist","Lead time","re-Order level","economic order qty",
                                             "APR","min shipping qty"};
              String sampleValues[][]={
                     {"AI","AC","CE","Switchgear inc Starters","AIACCE 270","Timer int pulse start 230v 2C/O 30mins",
                       "Timer interval pulse start 230v 2 closed open 30 minutes","AC/DC South Africa","IAP2 30M","each",
                       "Central Stores","2","500","5000","APR","5000"},
                       {"GI","IN","ZZ","Alternative power and accessories","GIINZZ 174","INV HT SERIES 2500W 12v/230v MOD SWV",
                            "INVERTER HT SERIES 2500W 12v/230v MODIFIED SINEWAVE","SINETECH","HT-P-2500-12","each",
                            "Central Stores","6","1000","5000","APR","10000"}
              productListTable=new JTable(sampleValues,productListColumns);
              JScrollPane scrollPane3=new JScrollPane(productListTable);
              productListTab.add(scrollPane3, BorderLayout.CENTER);
         public void createPage3()
              rateHistoryTab = new JPanel();
              rateHistoryTab.setLayout( new GridLayout( 3, 2 ) );
    }This class is called by invoking the DispalyForm() function from a main form. May you please run it and see how the 'factors' panel needs correcting and help me do that

    wondering if there's a method that can be used to show a window(i.e. dialog) within a frame (much like an MDI form). That is, all windows are shown w/in the frame's border or title bar.
    Here's what I have attempted but to no avail:
    java.awt.Dimension screen = getDefaultToolkit.getScreenSize();
    java.awt.Insets frameInsets = this.getInsets();  // frame's insets
    // set bounds of child (window)
    window1.setbounds(frameInsets.top, frameInsets.top,
       screen.width - frameInsets.top -2, screen.height - frameInsets.top -2);any help is appreciated

Maybe you are looking for

  • Glassfish SQLException: Error in allocating a connection in MySQL

    Hi All, I have just installed the Bundled Netbeans 6.5, Glassfish v2 and v3 Prelude (not including MySQL) that runs on top of MySQL 5.1 (separate installation) on server A, in order to mirror another similar working installation (Bundled Netbeans 6.1

  • How do I convert a PDF to a doc that I can email and receivers can't change the doc?

    I am emailing a 20 page PDF to a Board and need to have it in a form that can't be manipulated once it is received. Suggestions and how do I do it? (Obviously I'm very green in working with PDFs!)

  • How to add/set attribute "collectiveParentRDN" in DSEE6.3.1 installation.

    Hi, I'm new to DSEE and I have a question , I have a code which 1. First it binds to LDAP server through a proxy user. 2. Authenticates a user 3. Gathers all the roles that a user is a member of. It uses ,”collectiveParentRDN ” as a DN attribute. For

  • Get Only the direct children by name

    Hello all! Is there a way in JAXP to get only the direct children by name, as oppose to Element.getElementsByTagName(String name) that returns all the children with the given name of all descendant (not just of this one). Thanks in advance, Alon.

  • Restore is frozen and other issues.

    Yes i have read most of the forums here and else where however I am still having issues. It started when i tried to restore my Ipod to factory settings, however in the middle of the restore my battery died. Now it is stuck at a screen with an apple a