BorderLayout.NORTH for a Buttonpanel and JMenubar?

Is there a way to make both north?
Thanks.
Here is the relevent code: I tried to make it so that it displays it north then the string read from a file is set to top. But it dosn't display the buttonpanel north.
               gameMenu.add(hpset);
               gameMenu.add(censor);
               menuBar.add(fileMenu);
               menuBar.add(modMenu);
               menuBar.add(adminCP);
               menuBar.add(tools);
               adminCP.add(adminCommands);
               menuBar.add(gameMenu);
               modMenu.add(modCommands);
               tools.add(linkTools);
               /*Setting censor*/          
               ButtonGroup censr = new ButtonGroup();
               onz = new JRadioButtonMenuItem("On");
                  onz.setSelected(true);
               onz.addActionListener(this);
                  censr.add(onz);
                  censor.add(onz);
                      offz = new JRadioButtonMenuItem("Off");
                  censr.add(offz);
               offz.addActionListener(this);
                      censor.add(offz);
               /*End of setting hp*/
               /*Setting hp*/          
               ButtonGroup hpsel = new ButtonGroup();
               hpbar = new JRadioButtonMenuItem("Hitpoints bar");
                  hpbar.setSelected(true);
               hpbar.addActionListener(this);
                  hpsel.add(hpbar);
                  hpset.add(hpbar);
                      numbers = new JRadioButtonMenuItem("Numbers");
                  hpsel.add(numbers);
               numbers.addActionListener(this);
                      hpset.add(numbers);
               /*End of setting hp*/
               String place = C();
               if(place.startsWith("disable")) {
               buttonPanel.setEnabled(false);
               System.out.println("Disabling button panel.");
               if(place.startsWith("top")) {
               frame.getContentPane().add(buttonPanel, BorderLayout.NORTH);
               System.out.println("Setting button panel to top.");
               } else if(place.startsWith("bottem")) {
               frame.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
               System.out.println("Setting button panel to bottem.");
               if(!place.startsWith("top") && !place.startsWith("bottem") && !place.startsWith("disable")) {
               frame.getContentPane().add(buttonPanel, BorderLayout.SOUTH);
               System.out.println("No config file found. Setting default bar.");
               frame.getContentPane().add(menuBar, BorderLayout.NORTH);
               frame.getContentPane().add(gamePanel, BorderLayout.CENTER);
               frame.pack();
               frame.setVisible(true);
               init();C() is a method which uses bufferedwriter to read the line to see what setting the person wants.
Thanks

I can't read that unformatted code, so I can't help you directly, but I get the feeling that you're trying to put both the Buttonpanel and the JMenubar in the same BorderLayout.NORTH position, and you're finding that only the last one entered will be seen. What you need to do instead is create another JPanel, say northPanel, give it a proper layout, say BoxLayout configured to add components along the y-axis (to add a component just below the previous component), add your Buttonpanel and JMenubar to this northPanel and then add the northPanel to the main panel (the frame's contentPane), BorderLayout.NORTH.
Edited by: Encephalopathic on Jun 18, 2008 2:32 PM

Similar Messages

  • For loop issue and error exception

    I am finishing up a program and having a few issues....I can send my instructions so it may seem easier to what I want...the first issue deals with the for loop for the 2nd for loop in the actionperformed when i click on go it does not change any of the boxes to yellow
    Also when I check for errors it does not check with the code I have...I know it says on the instructions to use try\catch but I am just going to use if statements because I am not very familar with the try\catch and will accept some points takin off...any help with this by tonight id really appreciate it as long as noone is too busy...Thanks
    instructions:
    This will incorporate arrays, for loops, and Frames all in one.
    Create a panel containing an array of 16 TextArea components that change color to correspond with the start, stop, and step values entered by the user. Perform the following tasks to create the Checkerboard Array application shown below. When the user enters the start, stop, and step fields and then clicks the Go button, the results are also shown below.
    1.     Call your application Checkerboard.java
    2.     You will need the following variables� declare them as private:
    a.     16 component TextArea array
    b.     a Panel to hold the array
    c.     3 TextField components with length of 10
    d.     3 int variables to receive the start, stop, and step values
    e.     3 Labels to display the words Start, Stop, and Step
    f.     a Go button
    g.     a Clear button
    h.     a Panel to hold the 3 TextFields, 3 Labels, and the 2 Buttons
    3.     Create a constructor method to:
    a.     construct each of the components declared above and initializes the start, stop, and step variables to zero (when constructing the TextArea components, use the following parameters: null, 3, 5, 3)
    b.     set the Frame layout to BorderLayout
    c.     write a for loop to loop the array and set each of the 16 TextArea components in that array so they cannot be edited. In the same loop, set each of the TextArea components text to be 1 more than the index number. Also in this same loop, set the background of each of the TextArea components to white.
    d.     set the Panel for the TextArea components to GridLayout with 4 rows, 4 columns, and both gaps set to 10
    e.     set the Panel for the TextFields, Labels, and button to GridLayout with 3 rows, 3 columns, and both gaps set to 5
    f.     add the components to their respective Panels
    g.     make the buttons clickable
    h.     place the Panels in the Frame� put one in the NORTH and one in the CENTER
    i.     Enter the addWindowListener() method described in the chapter� this is the method that overrides the click of the X so it terminates the application
    4.     In your actionPerformed() method:
    a.     convert the data in your TextFields to int and store them in the variables declared above
    b.     write a loop that goes through the array setting every background color to blue
    c.     write another loop that�s based on the user inputs. Each time the loop is executed, change the background color to yellow (so� start your loop at the user�s specified starting condition. You�ll stop at the user�s specified stopping value. You�ll change the fields to yellow every time you increment your loop based on the step value. REMEMBER: Your displayed values are 1 off from your index numbers!!)
    5.     Write a main() method that creates an instance of the Checkerboard Frame.
    a.     set the bounds for the frame to 50, 100, 300, 400
    b.     set the title bar caption to Checkerboard Array
    c.     use the setVisible() method to display the application Frame during execution
    6.     After you get all of this complete, include error handling to make sure:
    a.     the values entered in the TextFields are valid integers
    b.     the start value is greater than or equal to 1 and less than or equal to 16
    c.     the stop value is greater than or equal to 1 and less than or equal to 16
    d.     the step value is greater than or equal to 1 and less than or equal to 16
    e.     the start condition is less than the stop condition
    f.     when an error occurs, give an error message in a dialog box that is specific to their error, remove the text from the invalid field, and put the cursor in that field so the user has a chance to re-enter� this can be accomplished by using multiple try/catch statements
    g.     only change the colors if the numbers are valid
    7.     Create a clear button as seen in the example below. This button should:
    a.     clear out all 3 TextFields
    b.     change the background color of all TextArea array elements to white
    c.     put the cursor in the start field
    8.     Document!!
    my code is:
    //packages to import
    import javax.swing.JOptionPane;
    import java.awt.*;
    import java.awt.event.*;
    public class Checkerboard extends Frame implements ActionListener
         private Panel topPanel;
         private TextArea topDisplay[];
         private Panel bottomPanel;
         private TextField startField = new TextField(10);
         private TextField stopField = new TextField(10);
         private TextField stepField = new TextField(10);
         private Label startLabel = new Label ("Start");
         private Label stopLabel = new Label ("Stop");
         private Label stepLabel = new Label ("Step");
         private Button goButton;
         private Button clearButton;
         private boolean clearText;
         private boolean first;
         private int start;
         private int stop;
         private int step;
         //constructor methods
         public Checkerboard()
              //construct components and initialize beginning values
              topPanel = new Panel();
              topDisplay = new TextArea[16];
              goButton = new Button("Go");
              clearButton = new Button("Clear");
              first = true;
              bottomPanel = new Panel();
              int start = 0;
              int stop = 0;
              int step = 0;
              bottomPanel.add(startField);
              bottomPanel.add(stopField);
              bottomPanel.add(stepField);
              bottomPanel.add(startLabel);
              bottomPanel.add(stopLabel);
              bottomPanel.add(stepLabel);
              bottomPanel.add(goButton);
              goButton.addActionListener(this);
              bottomPanel.add(clearButton);
              clearButton.addActionListener(this);
              clearText = true;
              //set layouts for the Frame and Panels
              setLayout(new BorderLayout());
              topPanel.setLayout(new GridLayout(4, 4, 10, 10));
              bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));
              //construct the Display
              for(int i = 0; i <= 15; i++)
                        topDisplay[i] = new TextArea(null, 3, 5, 3);
                        topDisplay.setText(String.valueOf(i+1));
                        topDisplay[i].setEditable(false);
                        topPanel.add(topDisplay[i]);
              //add components to frame
              add(topPanel, BorderLayout.NORTH);
              add(bottomPanel, BorderLayout.CENTER);
              //allow the x to close the application
              addWindowListener(new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                                  System.exit(0);
                   } //end window adapter
         public static void main(String args[])
              Checkerboard f = new Checkerboard();
              f.setTitle("Checkerboard Array");
              f.setBounds(50, 100, 300, 400);
              f.setLocationRelativeTo(null);
              f.setVisible(true);
         } //end main
         public void actionPerformed(ActionEvent e)
              //test go
              String arg = e.getActionCommand();
              //go button was clicked
              if(arg.equals("Go"))
                   //convert data in TextField to int
                   int start = Integer.parseInt(startField.getText());
                   int stop = Integer.parseInt(stopField.getText());
                   int step = Integer.parseInt(stepField.getText());
                   if((start <= 1) && (start > 16))
                        JOptionPane.showMessageDialog(null, "You must enter start between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                        startField.setText(" ");
                        startField.requestFocus();
                   if ((stop < 1) && (stop > 16))
                        JOptionPane.showMessageDialog(null, "You must enter stop between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                        stopField.setText(" ");
                        stopField.requestFocus();
                   if ((step < 1) && (step > 16))
                        JOptionPane.showMessageDialog(null, "You must enter step between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                        stepField.setText(" ");
                        stepField.requestFocus();
                   if (start < stop)
                        JOptionPane.showMessageDialog(null, "Stop cannot be larger than start", "Error", JOptionPane.ERROR_MESSAGE);
                        startField.setText(" ");
                        stopField.setText(" ");
                        stepField.setText(" ");
                        startField.requestFocus();
                   for(int i = 0; i <=16; i++)
                   topDisplay[i].setBackground(Color.blue);
                   for(int i = start; i <= stop; step++)
                   topDisplay[i].setBackground(Color.yellow);
              } //end the if go
              //clear button was clicked
              if(arg.equals("Clear"))
                   clearText = true;
                   startField.setText("");
                   stopField.setText("");
                   stepField.setText("");
                   first = true;
                   setBackground(Color.white);
                   startField.requestFocus();
              } //end the if clear
         }//end action listener
    }//end class

    got the yellow boxes to come up but just one box.....so is there something wrong with my yellow set background because I am not seeing any more errors
    //packages to import
    import javax.swing.JOptionPane;
    import java.awt.*;
    import java.awt.event.*;
    public class Checkerboard extends Frame implements ActionListener
         private Panel topPanel;
         private TextArea topDisplay[];
         private Panel bottomPanel;
         private TextField startField = new TextField(10);
         private TextField stopField = new TextField(10);
         private TextField stepField = new TextField(10);
         private Label startLabel = new Label ("Start");
         private Label stopLabel = new Label ("Stop");
         private Label stepLabel = new Label ("Step");
         private Button goButton;
         private Button clearButton;
         private boolean clearText;
         private boolean first;
         private int start;
         private int stop;
         private int step;
         //constructor methods
         public Checkerboard()
              //construct components and initialize beginning values
              topPanel = new Panel();
              topDisplay = new TextArea[16];
              goButton = new Button("Go");
              clearButton = new Button("Clear");
              first = true;
              bottomPanel = new Panel();
              int start = 0;
              int stop = 0;
              int step = 0;
              bottomPanel.add(startField);
              bottomPanel.add(stopField);
              bottomPanel.add(stepField);
              bottomPanel.add(startLabel);
              bottomPanel.add(stopLabel);
              bottomPanel.add(stepLabel);
              bottomPanel.add(goButton);
              goButton.addActionListener(this);
              bottomPanel.add(clearButton);
              clearButton.addActionListener(this);
              clearText = true;
              //set layouts for the Frame and Panels
              setLayout(new BorderLayout());
              topPanel.setLayout(new GridLayout(4, 4, 10, 10));
              bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));
              //construct the Display
              for(int i = 0; i <= 15; i++)
                        topDisplay[i] = new TextArea(null, 3, 5, 3);
                        topDisplay.setText(String.valueOf(i+1));
                        topDisplay[i].setEditable(false);
                        topPanel.add(topDisplay[i]);
              //add components to frame
              add(topPanel, BorderLayout.NORTH);
              add(bottomPanel, BorderLayout.CENTER);
              //allow the x to close the application
              addWindowListener(new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                                  System.exit(0);
                   } //end window adapter
              public static void main(String args[])
                        Checkerboard f = new Checkerboard();
                        f.setTitle("Checkerboard Array");
                        f.setBounds(50, 100, 300, 400);
                        f.setLocationRelativeTo(null);
                        f.setVisible(true);
                   } //end main
                   public void actionPerformed(ActionEvent e)
                        boolean done = false;
                        //test go
                        String arg = e.getActionCommand();
                        //go button was clicked
                        if(arg.equals("Go"))
                   //convert data in TextField to int
                   int start = Integer.parseInt(startField.getText());
                   int stop = Integer.parseInt(stopField.getText());
                   int step = Integer.parseInt(stepField.getText());
                   while(!done)
                        try
                             if((start <= 1) && (start > 16)) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "You must enter start between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                             startField.setText(" ");
                             startField.requestFocus();
                        } //end catch
                        try
                             if ((stop < 1) && (stop > 16)) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "You must enter stop between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                             stopField.setText(" ");
                             stopField.requestFocus();
                        } //end catch
                        try
                             if ((step < 1) && (step > 16)) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "You must enter step between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                             stepField.setText(" ");
                             stepField.requestFocus();
                        } //end catch
                        try
                             if (start > stop) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "Stop cannot be larger than start", "Error", JOptionPane.ERROR_MESSAGE);
                             startField.setText(" ");
                             stopField.setText(" ");
                             stepField.setText(" ");
                             startField.requestFocus();
                        } //end catch
              } //end while
                        for(int i = 0; i <=15; i++)
                        topDisplay[i].setBackground(Color.blue);
                        for(int i = start; i <= stop; step++)
                        topDisplay[i].setBackground(Color.yellow);
                   } //end the if go
                   //clear button was clicked
                   if(arg.equals("Clear"))
                        clearText = true;
                        startField.setText("");
                        stopField.setText("");
                        stepField.setText("");
                        first = true;
                        setBackground(Color.white);
                        startField.requestFocus();
                   } //end the if clear
         }//end action listener
    }//end class

  • Add buttons to BorderLayout.NORTH

    Hi, I am new to Java. I am using the BorderLayout for my frame. However, I am trying to add two buttons, two comboBoxes, and a checkBox to the NORTH region of the BorderLayout. Can't find anyway to add more than just one to the NORTH in my text book. I use the code below to add them, but the last item added is taking the entire NORTH region and covering the items added previously. If I assign them different regions, then they are all displayed.
         add( buttons[ 0 ], BorderLayout.NORTH );
         add( buttons[ 1 ], BorderLayout.NORTH );
         add( colorComboBox, BorderLayout.NORTH );
         add( shapeComboBox, BorderLayout.NORTH );
         add( filledCheckBox, BorderLayout.NORTH );
    I want to use BorderLayout so I can place a drawing area in the CENTER and the x, y coordinates in the SOUTH.
    Thank You,
    Mike

    Put the two buttons, two combo boxes, and checkbox into a panel with a FlowLayout, GridLayout, GridBagLayout, whatever layout you wish. Add only that panel to the BorderLayout.NORTH.

  • JPanel applied to BorderLayout.WEST covers BorderLayout.NORTH section, why?

    I am a newbie to swing, but thought that if you applied a panel to borderlayout.WEST, it would not overwrite another area.
    What have I missed, why has may applied panel overwritten borderlayout.NORTH?
    Many thanks.
    <code>
    import java.awt.*;
    import javax.swing.*;
    public class LayoutTest extends JPanel {
         Dimension bd = new Dimension(150,50);
         public LayoutTest(){
              setLayout(new BorderLayout());
              JPanel orderPanel = new JPanel();
              orderPanel.setLayout(new BoxLayout(orderPanel, BoxLayout.Y_AXIS));
              orderPanel.add(makeButton("rita"));
              orderPanel.add(makeButton("bob"));
              orderPanel.add(makeButton("sue"));
              add(orderPanel, BorderLayout.WEST);
         public JButton makeButton(String title) {
              JButton b = new JButton(title);
              b.setMaximumSize(bd);
              b.setMinimumSize(bd);
              b.setPreferredSize(bd);
              b.setBorder(BorderFactory.createCompoundBorder(
                                  BorderFactory.createEmptyBorder(5,5,5,5),
                                  b.getBorder()));
              b.setAlignmentX((float)0.5);
              return b;
         public static void main(String []args) throws Exception {
         JFrame f = new JFrame();
         f.setSize(600, 600);
         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         f.getContentPane().add(new LayoutTest());
         f.show();
    </code>

    I see, thanks.
    I thought each area wouldn't allow you to spill over.
    So, if I don't use an area, all other components will use the space, is that right?
    If I didn't want anything to populate the NORTH area (can't think of an example why), I guess you would have to add a (any) component to it?
    Just modified LayoutTest to populate the NORTH area to, and as you said, it displayed as I initially expected.
    It's gonna take a bit of getting used to this Swing business!
    Thanks for your help.
    <code>
    import java.awt.*;
    import javax.swing.*;
    public class LayoutTest extends JPanel {
         Dimension bd = new Dimension(150,50);
         public LayoutTest(){
              setLayout(new BorderLayout());
              JPanel orderPanel = new JPanel();
              orderPanel.setLayout(new BoxLayout(orderPanel, BoxLayout.Y_AXIS));
              orderPanel.add(makeButton("rita"));
              orderPanel.add(makeButton("bob"));
              orderPanel.add(makeButton("sue"));
              JPanel orderPanel2 = new JPanel();
              orderPanel2.add(makeButton("rita"));
              orderPanel2.add(makeButton("bob"));
              orderPanel2.add(makeButton("sue"));
              add(orderPanel, BorderLayout.WEST);
              add(orderPanel2, BorderLayout.NORTH);
         public JButton makeButton(String title) {
              JButton b = new JButton(title);
              b.setMaximumSize(bd);
              b.setMinimumSize(bd);
              b.setPreferredSize(bd);
              b.setBorder(BorderFactory.createCompoundBorder(
                                  BorderFactory.createEmptyBorder(5,5,5,5),
                                  b.getBorder()));
              b.setAlignmentX((float)0.5);
              return b;
         public static void main(String []args) throws Exception {
         JFrame f = new JFrame();
         f.setSize(600, 600);
         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         f.getContentPane().add(new LayoutTest());
         f.show();
    </code>

  • No longer have service at home....I've lived here for 3 years and never had a problem until now.

    I have been having issues for the last couple of months now with getting service on my cell phone at my house. Meaning, my phone literally says, "NO SERVICE" where I've always had service bars. I can't even send or receive a text message at home. Never, have I experienced these issues before. I've lived in this house for 3 years and have always been able to talk on my cell phone and send and receive text messages, until now. At first I chalked the issues up to the storms we had been having. Assuming a Verizon tower had possibly been hit. After several more weeks passed with the issue being unresolved, I went into my Verizon store and explained the issues I have been having. The rep I was working with suggested that I back up my phone and do a system restart on my iphone to see if that would fix the problem. I followed his instructions and the issue was still unresolved. I then went back into my Verizon store and explained the issue to the same representative I worked with the first time. He said it sounded like it was more of a software issue than a Verizon issue. Since my contract was up and I was good to get a new phone I decided to upgrade to the iPhone 5c (therefore I lost my unlimited data which irks me). When I got home I was shocked to see that I was STILL having the same issues. No Service. Can't text. Can't call. At this point I'm ready to lose my mind. Why am I paying for a service that I am not getting? We left on our family vacation this same day, so when we FINALLY reached a point down the road where I could receive service, I called my Verizon store to express my UNDERSTANDABLE frustrations. They were extremely helpful and have been since day 1. I ended up talking to a different representative than the one who had been helping me. She asked me to explain my situation and the issues I have been having since she hadn't been helping me she wasn't aware of what was going on. Once I explained my situation to her, she asked me where I lived at. Once I told her where I lived she IMMEDIATELY knew what my issue was. She told me that Verizon QUIT paying to use the Nex-tec tower that is by my house. She told me I'm not the first person that lives in my area to come in to their store with these SAME ISSUES. She told me that I needed to contact Verizon and complain and that hopefully if all of us kept complaining, Verizon would resolve the issue. I am WRITING you a complaint because I cannot CALL you off of my cell phone unless I drive SEVERAL miles down the road to a point where I can get service. I live on a busy highway that intersects with another busy highway a few miles down the road in North Central Kansas. I also live 3 miles from a STATE PARK with a VERY BUSY LAKE that doesn't have ANY SERVICE. I have talked to several friends, family members, and neighbors in my area and surrounding towns that are having the same issue as me and were told the same thing. Lovewell State Park is very popular and MANY people spend their weekends there. We have always had service there, until now, as well. Verizon customers that attend Lovewell State Park and that live in the surrounding towns cannot even call 911 off of their cell phone if their is an accident because we have NO SERVICE ANYMORE. I've been with Verizon since they ought out Altell. I have never had any issues with Verizon until now. Please take care of your customers. I trust that you care that you took service AWAY from customers who having been paying you for your service for several years and that you will resolve the issue quickly. We want our service BACK. We want to get service that we PAY FOR. If you cannot resolve the issues that I (and so many others) are having, I will be forced to switch to a new provider. As of right now, Verizon is doing me no service. Please change that. We live in an area where there are many accidents due to the types of jobs and winter weather we have in this area. It is necessary that we are able to make phone calls. I know that I am not the first nor will I be the last in our area to complain about this issue. Please fix these issues. Again, this information came straight from our Verizon store. They are just as upset as we are about the situation. The store doesn't want to lose us as customers and we would feel bad doing that to them when they have been such great people to work with. If the issues are not resolved we will be left with no other choice.

        @farmwife25
    After reading your post, I can certainly understand your concerns with this situation.  I would love to assist you finding a resolution for your service issues in your home area.  First, I'll need to ask you a few questions to help me in resolving.
    In what zip code do you experience this problem?  You mentioned service problems at your home.  Do you get a signal when you're outside at this location?  Have you spoken with our Technical Support Team regarding this issue in the past?  And if so, was a resolution ticket filed for this issue on your behalf?  Please let me know so that I can further assist.  Thanks!
    AnthonyTa_VZW
    Follow us on Twitter @VZWSupport

  • Interesting problem for all students and programmers Have a look!

    Hello. This is a very interesting problem for all programmers and students. I have my spalsh screen class which displays a splash when run from the main method in the same class. However when run from another class( in my case from my login class, when user name and password is validated) I create an instance of the class and show it. But the image in the splash is not shown. Only a squared white background is visible!!!.
    I am sending the two classes
    Can u tell me why and propose a solution. Thanks.
    import java.awt.*;
    import javax.swing.*;
    public class SplashScreen extends JWindow {
    private int duration;
    public SplashScreen(int d) {
    duration = d;
    // A simple little method to show a title screen in the center
    // of the screen for the amount of time given in the constructor
    public void showSplash() {
    JPanel content = (JPanel)getContentPane();
    content.setBackground(Color.white);
    // Set the window's bounds, centering the window
    int width = 300;
    int height =400;
    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    int x = (screen.width-width)/2;
    int y = (screen.height-height)/2;
    setBounds(x,y,width,height);
    // Build the splash screen
    JLabel label = new JLabel(new ImageIcon("logo2.gif"));
    JLabel copyrt = new JLabel
    ("Copyright 2004, Timetabler 2004", JLabel.CENTER);
    copyrt.setFont(new Font("Sans-Serif", Font.BOLD, 16));
    content.add(label, BorderLayout.CENTER);
    content.add(copyrt, BorderLayout.SOUTH);
    Color oraRed = new Color(100, 50, 80, 120);
    content.setBorder(BorderFactory.createLineBorder(oraRed, 10));
    // Display it
    setVisible(true);
    // Wait a little while, maybe while loading resources
    try { Thread.sleep(duration); } catch (Exception e) {}
    setVisible(false);
    public void showSplashAndExit() {
    showSplash();
    // System.exit(0);
    // CLASS CALLING THE SPLASH
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JMenu;
    import javax.swing.*;
    import java.applet.*;
    import java.applet.AudioClip;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import java.net.URL;
    public class login extends JDialog
    String username;
    String password;
    JTextField text1;
    JPasswordField text2;
    login()
    //super("Login To TIMETABLER");
    text1=new JTextField(10);
    text2 = new JPasswordField(10);
    text2.setEchoChar('*');
    JLabel label1=new JLabel("Username");
    JLabel label2=new JLabel("Password");
    label1.setFont(new Font("Garamond",Font.BOLD,16));
    label2.setFont(new Font("Garamond",Font.BOLD,16));
    JButton ok=new JButton(" O K ");
    ok.setActionCommand("ok");
    ok.setOpaque(false);
    ok.setFont(new Font("Garamond",Font.BOLD,14));
    ok.setBackground(SystemColor.controlHighlight);
    ok.setForeground(SystemColor.infoText);
    ok.addActionListener(new ActionListener (){
    public void actionPerformed(ActionEvent e)
    System.out.println("ddddd");
    //validatedata();
    ReadText mytext1=new ReadText();
    ReadText2 mytext2=new ReadText2();
    String value1=mytext1.returnpassword();
    String value2=mytext2.returnpassword();
    String user=text1.getText();
    String pass=text2.getText();
    System.out.println("->"+value1);
    System.out.println("->"+value2);
    System.out.println("->"+user);
    System.out.println("->"+pass);
    if ( (user.equals(value1)) && (pass.equals(value2)) )
    System.out.println("->here");
    // setVisible(false);
    // mainpage m=new mainpage();
    // m.setDefaultLookAndFeelDecorated(true);
    // m.callsplash();
    /// m.setSize(640,640);
    // m.show();
    //m.setVisible(true);
    SplashScreen splash = new SplashScreen(5000);
    // Normally, we'd call splash.showSplash() and get on with the program.
    // But, since this is only a test...
    splash.showSplashAndExit();
    else
    { text1.setText("");
    text2.setText("");
    //JOptionPane.MessageDialog(null,
    // "Your Password is Incorrect"
    JButton cancel=new JButton(" C A N C E L ");
    cancel.setActionCommand("cancel");
    cancel.setOpaque(false);
    cancel.setFont(new Font("Garamond",Font.BOLD,14));
    cancel.setBackground(SystemColor.controlHighlight);
    cancel.setForeground(SystemColor.infoText);
    cancel.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e)
    dispose();
    System.exit(0);
    JPanel pan1=new JPanel(new GridLayout(2,1,20,20));
    JPanel pan2=new JPanel(new GridLayout(2,1,20,20));
    JPanel pan3=new JPanel(new FlowLayout(FlowLayout.CENTER,20,20));
    pan1.setOpaque(false);
    pan2.setOpaque(false);
    pan3.setOpaque(false);
    pan1.add(label1);
    pan1.add(label2);
    pan2.add(text1);
    pan2.add(text2);
    pan3.add(ok);
    pan3.add(cancel);
    JPanel_Background main=new JPanel_Background();
    JPanel mainpanel=new JPanel(new BorderLayout(25,25));
    mainpanel.setOpaque(false);
    // mainpanel.setBorder(new BorderLayout(25,25));
    mainpanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder
    ("Login To Timetabler Vision"),BorderFactory.createEmptyBorder(10,20,10,20)));
    mainpanel.add("West",pan1);
    mainpanel.add("Center",pan2);
    mainpanel.add("South",pan3);
    main.add(mainpanel);
    getContentPane().add(main);
    void validatedata()
    ReadText mytext1=new ReadText();
    ReadText2 mytext2=new ReadText2();
    String value1=mytext1.returnpassword();
    String value2=mytext2.returnpassword();
    String user=text1.getText();
    String pass=text2.getText();
    System.out.println("->"+value1);
    System.out.println("->"+value2);
    System.out.println("->"+user);
    System.out.println("->"+pass);
    if ( (user.equals(value1)) && (pass.equals(value2)) )
    SplashScreen splash = new SplashScreen(5000);
    splash.showSplashAndExit();
    dispose();
    else
    { text1.setText("");
    text2.setText("");
    //JOptionPane.MessageDialog(null,
    // "Your Password is Incorrect"
    public void callsplash()
    {SplashScreen splash= new SplashScreen(1500);
    splash.showSplashAndExit();
    public static void main(String args[])
    { login m=new login();
    Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
    int screenPositionX=(int)(screenSize.width/2-390/2);
    int screenPositionY=(int)(screenSize.height/2-260/2);
    m.setLocation(screenPositionX, screenPositionY);
    //m.setResizable(false);
    m.setSize(600,500);
    m.setSize(390,260);
    m.setVisible(true);

    Hi Luis,
    Use tcode XK99 for vendor mass change, select the Fax no field. You have to take note that this changes will be only 1 fax number for all vendors.
    Else you have to use BAPI for mass change.
    regards,
    maia

  • What are the DAC endpoints for the Brazil and Japan data centers?

    Microsoft really should publish what the DAC endpoints for the new Brazil and Japan regions are. For instance, the one for North Central US is https://ch1prod-dacsvc.azure.com/DACWebService.svc and the one for Hong Kong is https://hkgprod-dacsvc.azure.com/DACWebService.svc
    . But I can find no information on the endpoints for the Japanese and Brazilian endpoints.
    Could you please publish a list of all the endpoints? It's essential for programmatic access to the SQL Azure REST API! Thanks!
    JasonC

    Hello,
    Thanks for sharing the information with us, it will benefits other who have same requirement.
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

  • Basic parameters to define the grouping for the Items and the BPs in SAPB1

    Dear Friends,
    What should be the basic parameters to define the grouping for the Items and the Business partners in SAP B1?
    What will be the case when the client wants to classify the sales revenues various categories?

    Hi
    What should be the basic parameters to define the grouping for the Items and the Business partners in SAP B1?
    For items:
    Raw Material.
    Capital Goods
    Finished Item
    Semi Finished Item.
    Conusmables
    Stationary .........etc
    or .
    Metal.
    Rubber
    Wooden.....etc
    Bsuiness Partner
    Foreign or domestic.
    Region wise e.g South,North,East,West.
    State wise  e.g MH,KT,DELHI,GOA....ETC
    What will be the case when the client wants to classify the sales revenues various categories?
    SIMILARLY
    Foreign Revenue, Doomestic Revenue, Region Wise Revenue, State wise, Or Territory wise.......etc
    I hope this clarifies you
    Ashish Gupte

  • Report for Qty Contract and Value Contract with PO release exceeding limits

    Hi All,
    Is there a std report in SAP that the users can use to view Qty and Val Contracts that has exceed in Qty (in case of Qty Contracts) or Val (in case of Val Contracts) ?
    Thanks in advance!

    hi Duke,
    If thinking logically, then there is no report for the same..this may be because you enter the qty or value limits in the contract doc itself....So, when you make the PO for the same, and if the qty or value exceeds the system automatically provides the message..stating that the qty or value has exceeded....
    So, there is no report for the same...
    Hope it helps...
    Regards
    Priyanka.P

  • Report for daily production and daily sales quantities

    Can you Please any body let me know what fields and tables should I pick to generate a report for sales qty and production qty for a material on daily basis. we are using PP PI

    Hi,
    You can use table MSEG for that purpose. Try BUDAT-MKPF as one of the selection parameters and use
    MBLNR-MKPF = MBLNR-MSEG
    MJHAR-MKPF = MJHAR-MSEG
    Sort the results in ERFMG-MSEG and ERFME-MSEG using
    BWART-MSEG = 101 minus 102 (for production)
    SOBKS-MSEG = E
    BWART-MSEG = 601 minus 602 (for sales).
    Above stuff might be useful to you for your development requirement provided you are having Sales Order specific production.
    Thanks & Regards,
    Abu Arbab A

  • We have multiple devices in our family.  On each iPad/iPhone each user has their own apple id for iMessage, Facetime and icloud, but we all sign in to the same apple id for itunes.  When one of my kids comments on my shared photostream, it shows my name??

    We have multiple devices in our family.  On each iPad/iPhone each user has their own apple id for iMessage, Facetime and icloud, but we all sign in to the same apple id for itunes.  When one of my kids comments on my shared photostream, it shows my name and not theirs as the commenter.  How do I fix that?

    CREATE A NEW USER
    Go to System Preferences --> Create a New User in Users & Groups
    Decide on whether to setup as Admin or Standard User.
    Switch to the New User by logging out under the Apple in the Menu Bar or use Fast User Switching
    Fast User Switching allows other users to leave current applications and windows open. Depending on RAM, you might need to log out rather than use FUS.

  • HT201250 Can I partition my external hard drive and use one partion for time machine and the other one for data that i may want to use in different computers?

    I have this doubt. I've just bought an external drive, especifically a Seagate GoFlex Desk 3 tb.
    I want to know if it is recomendable to make a partion exclusively for time machine and let another one so I can put there music, photos, videos, etc that I should need to use or copy to another computer.
    May half and half, 1.5 tb for time machine and 1.5 tb for data.
    I have an internal hard drive of 500 GB (499.25 GB) in my macbook pro.
    Any recommendation?

    As I said, yes. Be sure your Time Machine partition has at least 1 TB for backups.
    1. Open Disk Utility in your Utilities folder.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to two (2). Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.

  • Ok, I have two itunes library account one for the PC and one for my Mac, I have my first iphone on my PC, but i just upgrade and I would like to use my new iphone on my Mac but all of my apps and other stuff is in the first library.. How do I put my apps

    ok, I have two itunes librarys account, one for my PC and one for my Mac, I use the PC for my iphone, but I upgrade my iphone and all my apps and
    stuff is on the first itunes library. How do I put the apps from one iphone to the otherusing two dirffernt itunes library? please help..

    Drrhythm2 wrote:
    What's the best solution for this? I
    Copy the entire /Music/iTunes/ folder from her old compouter to /Music/ in her account on this new computer.

  • One account for itunes match and one for all the rest?

    Hello everybody
    I was wondering how to use an Apple ID for iTunes Match and other for iCloud and backups. I found an article on the website that said that you actually can do that, but my question arises when I find out that now I only use one ID, all my apps are in there, along with my iPhone backups and stuff. So, if I create an ID for subscribing to iTM, will I lose the ability to update my apps on the old ID?
    Please help!
    The article is: http://support.apple.com/kb/HT4895
    Cheers

    I know, but I can't use my credit card on my iTunes Store account, since it's a US ID. What if I change the country of my ID? How often can I change it? I was thinking of changing it, purchasing iTM, and then changing it back... can I do that?
    Thank you

  • Can I have one Apple ID for personal (music) and one for work (syncing contacts and mail)  on the save device

    Between my husband and I we have 6 devices and we are only allowed to share our Apple ID across 5.  Some of the devices are for music and outlook and some are just for music - can I have a separate Apple ID for my mail and contacts.  ie. Can you use two different Apple ID's on the same device?

    Oh maybe ipads and iphones aren't counted in the five

Maybe you are looking for

  • Can't add new layer

    This has to be somthing simple and stupid.  Using Elements 8, here is what I'm doing: 1) Using main menu, click "File / Open" 2) Select a Canon RAW file (.CR2) 3) File opens in Camera Raw 4) On Camera Raw dialog  click "Open Image" 5) Camera Raw dial

  • Ruby on Rails environment

    I have tried the Apple tutorial and Adam Blackbourne's book and website and still cannot get a functional environment started so that I can develop using Ruby on Rails. I get Ruby installed, Textmate installed, and then seem to get bogged down with T

  • Import Requests failed in CONS

    Hi I'm facing the problem of import requests being failed in CONS. The reason being for that is: <b>the import failed because not every request including follow-up requests were processed</b> I've checked the following things: a) idleStart  is set to

  • Oracle 10G error - while installing 4.6C

    Dear all, I have tried installing 4.6c directly in oracle 10g in a HPUXIA64 server. I followed the note 946141 and did the central instance and also installed Oracle and upgrade it to 10.2.0.2 then applied the interim patches. After applying the inte

  • Statistical Postings  on a Cost Center

    I am developing a report on actual postings on a Cost Center, however I want to exclude statistical postings on the cost center. One of the way is I feel is the alternate objects assigned to the line item, however is there an alternate way where a li