Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Using the Box class
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Neoco




PostPosted: Sat May 19, 2012 3:09 pm   Post subject: Using the Box class

I'm still working on my computer science summative and now I need help with shifting my components downward

summative:

import java.awt.*;
import javax.swing.*;

public class conceptstemplate extends JApplet
{
        Box sidebar = new Box (BoxLayout.LINE_AXIS);
       
        JButton next = new JButton ("Next >");
        JButton previous = new JButton ("< Previous");
        JButton mmenu = new JButton ("Main Menu");
       
        public void init ()
        {
                setSize (1000, 600);
                setBackground (Color.lightGray);
               
               
                //sidebar.add (Box.createRigidArea (new Dimension (50, 450)));
                //sidebar.add (Box.createVerticalStrut (450));
                //sidebar.setBounds (0, 450, getWidth (), 150);
                //sidebar.add (Box.createHorizontalGlue ());
               
                sidebar.add (Box.createHorizontalStrut (50));
                sidebar.add (mmenu);
                sidebar.add (Box.createHorizontalStrut (600));
                sidebar.add (previous);
                sidebar.add (Box.createHorizontalStrut (50));
                sidebar.add (next);
               
                add (sidebar);
        }
}


This is supposed to create a few buttons at the bottom of the screen. What I'm having trouble with is shifting these buttons to the bottom of the screen. The methods with the "//" next to them are the methods I have tried using and that haven't worked. Help please?
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: