Setting Up a GUI - FlowLayout - Using Two JPanels

Hello:
I am getting confused with setting up a GUI with two JPanels one that would be on top and the other middlePanel having a FlowLayout.
I set up two JPanels but obviously have something wrong because my northPanel has "disappeared" when I added a middlePanel. My componets are all over the place and again my northPanel is no longer showing.
Idea of what I'm doing.
1) Enter total number of diners
2)Confirm that diners # is correct.
3)Enter name of Diner
4)Take order - Entree (Pull-Down)
5)Two sides (CheckBox)
6)Display Completed Order of diners.
P.S. I hope my question is not too stupid I am new and has justed started Java Programming. I have tried to look through the Documentation but am getting confused with GUI relating to FlowLayout, GridLayout. etc. I'm just not sure which one I should use to set up my GUI in an organized manner. Am I on the right track or is my code completely screwed. Thanks.
** My Code **
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Menu extends JFrame {
private JTextField partyNumField, dinerName;
private JComboBox orderComboBox;
private int partyNum;
private JButton getParty, continueOrder;
private JLabel party, companyLogo, dinerLabel, entreeOrder;
private String dinnerEntree[] = {"Filet Mignon", "Chicken Cheese Steak", "Tacos", "Ribs"};
private JCheckBox mashed, cole, baked, french;
public Menu() {
super("O'Brien Caterer - Where we make good Eats!");
Container container = getContentPane();
JPanel northPanel = new JPanel();
northPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 80, 5));
companyLogo = new JLabel("Welcome to O'Brien's Caterer's");
northPanel.add(companyLogo);
party = new JLabel("Enter the Total Number in Party Please");
partyNumField = new JTextField(5);
northPanel.add(party);
northPanel.add(partyNumField);
getParty = new JButton("GO - Continue with Order");
getParty.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent actionEvent)
partyNum = Integer.parseInt(partyNumField.getText());
String ans=JOptionPane.showInputDialog(null, "Total Number is party is: "
+ partyNum + " is this correct?\n\n" + "Enter 1 to continue\n"
+ "Enter 2 to cancel\n");
if (ans.equals("1")) {
System.out.println(ans+"=continue"); // handle continue
} else { // assume to be 2 for cancel
System.out.println(ans+"=cancel"); // handle cancel
); // end Listener
northPanel.add(getParty);
JPanel middlePanel = new JPanel();
middlePanel.setLayout(new FlowLayout(FlowLayout.CENTER));
dinerLabel = new JLabel("Please enter Diner's name");
dinerName = new JTextField(30);
continueOrder = new JButton("continue");
middlePanel.add(dinerLabel);
middlePanel.add(continueOrder);
middlePanel.add(dinerName);
entreeOrder = new JLabel("Please choose an entree");
orderComboBox = new JComboBox(dinnerEntree);
orderComboBox.setMaximumRowCount(4);
//orderComboBox.addItemListener(
// new ItemListener(){
// public void itemsStateChanged(ItemEvent event)
// if (event.getStateChange() == ItemEvent.SELECTED)
// add entree order to Person
// continue ** enable the two sides order
mashed = new JCheckBox("Mashed Potatoes");
middlePanel.add(mashed);
cole = new JCheckBox("Cole Slaw");
middlePanel.add(cole);
baked = new JCheckBox("Baked Beans");
middlePanel.add(baked);
french = new JCheckBox("FrenchFries");
middlePanel.add(french);
// CheckBoxHandler handler = new CheckBoxHandler();
// mashed.addItemListener(handler);
// cole.addItemListener(handler);
// baked.addItemListener(handler);
// french.addItemListener(handler);
middlePanel.add(entreeOrder);
middlePanel.add(orderComboBox);
container.add(northPanel);
container.add(middlePanel);
middlePanel.setEnabled(true);
setSize(500, 500);
show();
// private class to handle event of choosing Check BOx Item
// private class CheckBoxHandler implements ItemListener{
// private int count = 0;
// public void itemStateChanged(ItemEvent event){
// if (event.getsource() == mashed)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
// add mashed choice to person's order
// if (event.getsource() == cole)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
//add cole slaw to person's order
// if (event.getsource() == baked)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
//add baked beans to person's order
// if (event.getsource() == french)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
//add french to person's order
public static void main(String args[])
Menu application = new Menu();
application.addWindowListener(
new WindowAdapter(){
public void windowClosing(WindowEvent windowEvent)
System.exit(0);
}

This looks better, i myself don't like the flow layout
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Menu1 extends JFrame
     private JTextField partyNumField, dinerName;
     private JComboBox orderComboBox;
     private int partyNum;
     private JButton getParty, continueOrder;
     private JLabel party, companyLogo, dinerLabel, entreeOrder;
     private String dinnerEntree[] = {"Filet Mignon", "Chicken Cheese Steak", "Tacos", "Ribs"};
     private JCheckBox mashed, cole, baked, french;
public Menu1()
     super("O'Brien Caterer - Where we make good Eats!");
     addWindowListener(new WindowAdapter()
         public void windowClosing(WindowEvent ev)
               dispose();
               System.exit(0);
     Container container = getContentPane();
     JPanel northPanel = new JPanel();
     northPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 120,15));
     companyLogo   = new JLabel("Welcome to O'Brien's Caterer's");
     northPanel.add(companyLogo);
     party         = new JLabel("Enter the Total Number in Party Please");
     partyNumField = new JTextField(5);
     northPanel.add(party);
     northPanel.add(partyNumField);
     getParty    = new JButton("GO - Continue with Order");
     northPanel.add(getParty);
     northPanel.setPreferredSize(new Dimension(700,150));
     getParty.addActionListener(new ActionListener()
          public void actionPerformed(ActionEvent actionEvent)
               partyNum = Integer.parseInt(partyNumField.getText());
               String ans=JOptionPane.showInputDialog(null, "Total Number is party is: "
               + partyNum + " is this correct?\n\n" + "Enter 1 to continue\n"
               + "Enter 2 to cancel\n");
               if (ans.equals("1"))
                    System.out.println(ans+"=continue"); // handle continue
               else { // assume to be 2 for cancel
               System.out.println(ans+"=cancel"); // handle cancel
     }}); // end Listener
     JPanel middlePanel = new JPanel();
     middlePanel.setLayout(new FlowLayout(FlowLayout.CENTER));
     dinerLabel         = new JLabel("Please enter Diner's name");
     dinerName          = new JTextField(30);
     continueOrder      = new JButton("continue");
     middlePanel.add(dinerLabel);
     middlePanel.add(dinerName);
     middlePanel.add(continueOrder);
     entreeOrder   = new JLabel("Please choose an entree");
     orderComboBox = new JComboBox(dinnerEntree);
     orderComboBox.setMaximumRowCount(4);
//orderComboBox.addItemListener(
// new ItemListener(){
// public void itemsStateChanged(ItemEvent event)
// if (event.getStateChange() == ItemEvent.SELECTED)
// add entree order to Person
// continue ** enable the two sides order
     mashed = new JCheckBox("Mashed Potatoes");
     middlePanel.add(mashed);
     cole   = new JCheckBox("Cole Slaw");
     middlePanel.add(cole);
     baked  = new JCheckBox("Baked Beans");
     middlePanel.add(baked);
     french = new JCheckBox("FrenchFries");
     middlePanel.add(french);
// CheckBoxHandler handler = new CheckBoxHandler();
// mashed.addItemListener(handler);
// cole.addItemListener(handler);
// baked.addItemListener(handler);
// french.addItemListener(handler);
     middlePanel.add(entreeOrder);
     middlePanel.add(orderComboBox);
//container.add(northPanel);
//container.add(middlePanel);
     container.add(northPanel, java.awt.BorderLayout.NORTH);
     container.add(middlePanel, java.awt.BorderLayout.CENTER);
     middlePanel.setEnabled(true);
     setSize(600, 500);
     show();
// private class to handle event of choosing Check BOx Item
// private class CheckBoxHandler implements ItemListener{
// private int count = 0;
// public void itemStateChanged(ItemEvent event){
// if (event.getsource() == mashed)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
// add mashed choice to person's order
// if (event.getsource() == cole)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
//add cole slaw to person's order
// if (event.getsource() == baked)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
//add baked beans to person's order
// if (event.getsource() == french)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
//add french to person's order
public static void main(String args[])
     new Menu1();
no edit
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Menu1 extends JFrame
     private JTextField partyNumField, dinerName;
     private JComboBox orderComboBox;
     private int partyNum;
     private JButton getParty, continueOrder;
     private JLabel party, companyLogo, dinerLabel, entreeOrder;
     private String dinnerEntree[] = {"Filet Mignon", "Chicken Cheese Steak", "Tacos", "Ribs"};
     private JCheckBox mashed, cole, baked, french;
public Menu1()
     super("O'Brien Caterer - Where we make good Eats!");
     addWindowListener(new WindowAdapter()
     public void windowClosing(WindowEvent ev)
               dispose();
               System.exit(0);
     Container container = getContentPane();
     JPanel northPanel = new JPanel();
     northPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 120,15));
     companyLogo = new JLabel("Welcome to O'Brien's Caterer's");
     northPanel.add(companyLogo);
     party = new JLabel("Enter the Total Number in Party Please");
     partyNumField = new JTextField(5);
     northPanel.add(party);
     northPanel.add(partyNumField);
     getParty = new JButton("GO - Continue with Order");
     northPanel.add(getParty);
     northPanel.setPreferredSize(new Dimension(700,150));
     getParty.addActionListener(new ActionListener()
          public void actionPerformed(ActionEvent actionEvent)
               partyNum = Integer.parseInt(partyNumField.getText());
               String ans=JOptionPane.showInputDialog(null, "Total Number is party is: "
               + partyNum + " is this correct?\n\n" + "Enter 1 to continue\n"
               + "Enter 2 to cancel\n");
               if (ans.equals("1"))
                    System.out.println(ans+"=continue"); // handle continue
               else { // assume to be 2 for cancel
               System.out.println(ans+"=cancel"); // handle cancel
     }}); // end Listener
     JPanel middlePanel = new JPanel();
     middlePanel.setLayout(new FlowLayout(FlowLayout.CENTER));
     dinerLabel = new JLabel("Please enter Diner's name");
     dinerName = new JTextField(30);
     continueOrder = new JButton("continue");
     middlePanel.add(dinerLabel);
     middlePanel.add(dinerName);
     middlePanel.add(continueOrder);
     entreeOrder = new JLabel("Please choose an entree");
     orderComboBox = new JComboBox(dinnerEntree);
     orderComboBox.setMaximumRowCount(4);
//orderComboBox.addItemListener(
// new ItemListener(){
// public void itemsStateChanged(ItemEvent event)
// if (event.getStateChange() == ItemEvent.SELECTED)
// add entree order to Person
// continue ** enable the two sides order
     mashed = new JCheckBox("Mashed Potatoes");
     middlePanel.add(mashed);
     cole = new JCheckBox("Cole Slaw");
     middlePanel.add(cole);
     baked = new JCheckBox("Baked Beans");
     middlePanel.add(baked);
     french = new JCheckBox("FrenchFries");
     middlePanel.add(french);
// CheckBoxHandler handler = new CheckBoxHandler();
// mashed.addItemListener(handler);
// cole.addItemListener(handler);
// baked.addItemListener(handler);
// french.addItemListener(handler);
     middlePanel.add(entreeOrder);
     middlePanel.add(orderComboBox);
//container.add(northPanel);
//container.add(middlePanel);
     container.add(northPanel, java.awt.BorderLayout.NORTH);
     container.add(middlePanel, java.awt.BorderLayout.CENTER);
     middlePanel.setEnabled(true);
     setSize(600, 500);
     show();
// private class to handle event of choosing Check BOx Item
// private class CheckBoxHandler implements ItemListener{
// private int count = 0;
// public void itemStateChanged(ItemEvent event){
// if (event.getsource() == mashed)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
// add mashed choice to person's order
// if (event.getsource() == cole)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
//add cole slaw to person's order
// if (event.getsource() == baked)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
//add baked beans to person's order
// if (event.getsource() == french)
// if (event.getStateChange() == ItemEvent.SELECTED)
// count++;
//add french to person's order
public static void main(String args[])
     new Menu1();
}

Similar Messages

  • Help!  GUI using two buttons

    Hello all:
    I have created a class for reading and writing to a text file on my hard drive. Also, I have created another class for a GUI to use for opening the text file with a button labeled Display. As you will see in the code below, I have created another button labeled Update. I seek to be able to edit and save the text directly in the text area with the Update button after opening the file with the Display button. Any help would be greatly appreciated. Thanks!
    /** Class TextFile */
    import java.io.*;
    public class TextFile
        public String read(String fileIn) throws IOException
            FileReader fr = new FileReader(fileIn);
            BufferedReader br = new BufferedReader(fr);
            String line;
            StringBuffer text = new StringBuffer();
            while((line = br.readLine()) != null)
              text.append(line+'\n');
            return text.toString();
        } //end read()
        public void write(String fileOut, String text, boolean append)
            throws IOException
            File file = new File(fileOut);
            FileWriter fw = new FileWriter(file, append);
            PrintWriter pw = new PrintWriter(fw);
            pw.println(text);
            fw.close();
        } // end write()
    } // end class TextFile
    /** Class TextFileGUI */
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TextFileGUI implements ActionListener
        TextFile tf = new TextFile();
        JTextField filenameField = new JTextField (30);
        JTextArea fileTextArea = new JTextArea (10, 30);
        JButton displayButton = new JButton ("Display");
        JButton updateButton = new JButton ("Update");
        JPanel panel = new JPanel();
        JFrame frame = new JFrame("Text File GUI");
        public TextFileGUI()
            panel.add(new JLabel("Filename"));
            panel.add(filenameField);
            panel.add(fileTextArea);
            fileTextArea.setLineWrap(true);
            panel.add(displayButton);
            displayButton.addActionListener(this);
            panel.add(updateButton);
            updateButton.addActionListener(this);
            frame.setContentPane(panel);
            frame.setSize(400,400);
            frame.setVisible(true);
        } //end TextFileGUI()
        public void actionPerformed(ActionEvent e)
            String t;
            try
                t = tf.read(filenameField.getText());
                fileTextArea.setText(t);
            catch(Exception ex)
                fileTextArea.setText("Exception: "+ex);
            } //end try-catch
        } //end actionPerformed()
    } //end TextFileGUI

    Swing related questions should be posted in the Swing forum.
    You are using the same ActionListener for both buttons, so you need to be able to tell which button was pressed. There are a couple of ways to do this:
    a) use the getSource() method of the ActionEvent and compare the source against your two buttons to see which one was pressed and then invoke the appropriate code.
    Object source = e.getSource();
    if (source == displayButton)
        //  do display processing
    else if (source == updateButton)
        //  do update processingb) Check the action command to determine which button was clicked. This approach is demonstrated in the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/button.html]How to Use Buttons
    Another option is to create separate ActionListeners for each button so there is no confusion
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    class TextAreaLoad
         public static void main(String a[])
              final JTextArea edit = new JTextArea(5, 40);
              JButton read = new JButton("Read some.txt");
              read.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             FileReader reader = new FileReader( "some.txt" );
                             BufferedReader br = new BufferedReader(reader);
                             edit.read( br, null );
                             edit.requestFocus();
                        catch(Exception e2) { System.out.println(e2); }
              JButton write = new JButton("Write some.txt");
              write.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             FileWriter writer = new FileWriter( "some.txt" );
                             BufferedWriter bw = new BufferedWriter( writer );
                             edit.write( bw );
                             edit.setText("");
                             edit.requestFocus();
                        catch(Exception e2) {}
              JFrame frame = new JFrame("TextArea Load");
              frame.getContentPane().add( new JScrollPane(edit), BorderLayout.NORTH );
              frame.getContentPane().add(read, BorderLayout.WEST);
              frame.getContentPane().add(write, BorderLayout.EAST);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }

  • HT204053 If I have set up my Mac with two different users,  can I use two different Apple IDs on the same Mac?

    If I have set up my Mac with two different users,  can I use two different Apple IDs on the same Mac?

    Each user account may have its own Apple ID.

  • I cannot figure out how to set my apple id to use: itunes (two of accounts), apps store and Itunes store. How do I make one password that will be recognixed by all these devices?

    I cannot figure out how to set my apple id to use: itunes (two of accounts), apps store and itunes store. How do I make one password that will be recognized by all these devices? My apple id is constantly not working.

    Hi Lrwill,
    If the apps that are on your son's iPad were purchased under his Dad's Apple ID, then signing your Apple ID onto the iPad will not help you with updating those apps.
    Also, if the iPad was sync'd with his Dad's iTunes library, then hooking it up to your computer/iTunes library, will require you to reset the iPad, and everything that was loaded under the other Library and Apple ID will be wiped out.
    Can you provide a little more info about what was set up under which Apple ID and what iTunes library the iPad was sync'd with?
    Cheers,
    GB

  • I set up my new computer using the apple ID i always use, and then later migrated all my files from my old mac book to the same new one, but under a different user (same ID). how do i consolidate the two users on my new mac book?

    i set up my new computer using the apple ID i always use, and then later migrated all my files from my old mac book to the same new one, but under a different user (same apple ID). how do i consolidate the two users on my new mac book?

    Well if you use the Finder Go menu to Computer, a window opens up double click on your boot drive and then on Users folder, open the other user folder and open Public and drop your files into DropBox
    When you do this it will copy them and change the permissions and user assigned to it, so log into the other user and place them into your respective normal folders.
    Once you have all your files over and don't need the old user, use System Preferences > Accounts to delete it if you wish, however it's good two Admin accounts on the machine in case something bad happens in the other. Some people for security reasons on use a Standard account for most uses and a emergency Admin account.
    One can still do most Admin things in Standard user.

  • When I set up my iMac I used one of two iTunes accounts I have, I now need to change it to the other one......any ideas?! Thanks in advance

    When I set up my iMac I used one of two iTunes accounts I have, I now need to change it to the other one......any ideas?! Thanks in advance

    Hi Pompey Woody,
    Thanks for visiting Apple Support Communities.
    If you need to use a different Apple ID (iTunes Store account) with iTunes on your Mac, you can sign out and then back in with the other account:
    Open iTunes. ...select Store > Sign Out, then select Store > Sign In and enter your current Apple ID.
    These steps are found in this article:
    Apple ID: What to do after you change your Apple ID
    http://support.apple.com/kb/HT5796
    You may also find the information in this article helpful:
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Best,
    Jeremy

  • How to set my own gui status when i use selection-screen

    how to set my own gui status when i use selection-screen command
    and
    how to set the names in the application tool bar when function keys are created

    Make sure that you do this in event "AT SELECTION-SCREEN OUTPUT".
    Run Txn ABAPDOCU and check 'DEMO_SEL_SCREEN_STATUS' for sample.
    Also check out following discussion -
    Selection Screen PF-STATUS
    Cheers,
    Sanjeev

  • JButton not visible after use of Jpanel removeAll ..

    Hi!
    I'm having a calculator class that inherits JFrame. I need to add more buttons after setting an option from the (view) menu bar .. (from normal to scientific calculator). I needed to use the JPanel removeAll method and then add the normal buttons plus extra buttons. But the problem is, that the Buttons are only visible when I touch them with the mouse.
    Does anybody know why? Thanks for your help!
    See code below (still in construction phase):
    Name: Hemanth. B
    Original code from Website: java-swing-tutorial.html
    Topic : A basic Java Swing Calculator
    Conventions Used in Source code
         1. All JLabel components start with jlb*
         2. All JPanel components start with jpl*
         3. All JMenu components start with jmenu*
         4. All JMenuItem components start with jmenuItem*
         5. All JDialog components start with jdlg*
         6. All JButton components start with jbn*
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Calculator extends JFrame
    implements ActionListener {
    // Constants
    final int NORMAL = 0;
    final int SCIENTIFIC = 8;
    final int MAX_INPUT_LENGTH = 20;
    final int INPUT_MODE = 0;
    final int RESULT_MODE = 1;
    final int ERROR_MODE = 2;
    // Variables
    int displayMode;
    int calcType = SCIENTIFIC;
    boolean clearOnNextDigit, percent;
    double lastNumber;
    String lastOperator, title;
    private JMenu jmenuFile, jmenuView, jmenuHelp;
    private JMenuItem jmenuitemExit, jmenuitemAbout;
    private JRadioButtonMenuItem jmenuItemNormal = new JRadioButtonMenuItem("Normal");
    private JRadioButtonMenuItem jmenuItemScientific = new JRadioButtonMenuItem("Scientific");
    private     ButtonGroup viewMenuButtonGroup = new ButtonGroup();
    private JLabel jlbOutput;
    private JButton jbnButtons[];
    private JPanel jplButtons, jplMaster, jplBackSpace, jplControl;
    * Font(String name, int style, int size)
    Creates a new Font from the specified name, style and point size.
    Font f12 = new Font("Verdana", 0, 12);
    Font f121 = new Font("Verdana", 1, 12);
    // Constructor
    public Calculator(String title) {
    /* Set Up the JMenuBar.
    * Have Provided All JMenu's with Mnemonics
    * Have Provided some JMenuItem components with Keyboard Accelerators
         //super(title);
         this.title = title;
         //displayCalculator(title);
    }     //End of Contructor Calculator
    private void displayCalculator (String title) {
         //add WindowListener for closing frame and ending program
         addWindowListener (
         new WindowAdapter() {     
         public void windowClosed(WindowEvent e) {
         System.exit(0);
         //setResizable(false);
    //Set frame layout manager
         setBackground(Color.gray);
         validate();
         createMenuBar();
         createMasterPanel();      
         createDisplayPanel();
         clearAll();
         this.getContentPane().validate();
         requestFocus();
         pack();
         //getContentPane().
         setVisible(true);
    private void createMenuBar() {
    jmenuFile = new JMenu("File");
    jmenuFile.setFont(f121);
    jmenuFile.setMnemonic(KeyEvent.VK_F);
    jmenuitemExit = new JMenuItem("Exit");
    jmenuitemExit.setFont(f12);
    jmenuitemExit.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_X,
                                            ActionEvent.CTRL_MASK));
    jmenuFile.add(jmenuitemExit);
    jmenuView = new JMenu("View");
    jmenuFile.setFont(f121);
    jmenuFile.setMnemonic(KeyEvent.VK_W);
    jmenuItemNormal.setMnemonic(KeyEvent.VK_N);
    viewMenuButtonGroup.add(jmenuItemNormal);
    jmenuView.add(jmenuItemNormal);
    jmenuItemScientific.setMnemonic(KeyEvent.VK_S);
    viewMenuButtonGroup.add(jmenuItemScientific);
    jmenuView.add(jmenuItemScientific);
    if (jmenuItemNormal.isSelected() == false &&
    jmenuItemScientific.isSelected() == false)
    jmenuItemScientific.setSelected(true);
         jmenuHelp = new JMenu("Help");
         jmenuHelp.setFont(f121);
         jmenuHelp.setMnemonic(KeyEvent.VK_H);
         jmenuitemAbout = new JMenuItem("About Calculator");
         jmenuitemAbout.setFont(f12);
         jmenuHelp.add(jmenuitemAbout);
         JMenuBar menubar = new JMenuBar();
         menubar.add(jmenuFile);
         menubar.add(jmenuView);
         menubar.add(jmenuHelp);
         setJMenuBar(menubar);
         jmenuItemNormal.addActionListener(this);
         jmenuItemScientific.addActionListener(this);
         jmenuitemAbout.addActionListener(this);
         jmenuitemExit.addActionListener(this);
    private void createDisplayPanel() {
         if (jlbOutput != null) {
         jlbOutput.removeAll();     
         jlbOutput = new JLabel("0",JLabel.RIGHT);
         jlbOutput.setBackground(Color.WHITE);
         jlbOutput.setOpaque(true);
         // Add components to frame
         getContentPane().add(jlbOutput, BorderLayout.NORTH);
         jlbOutput.setVisible(true);
    private void createMasterPanel() {
         if (jplMaster != null) {
         jplMaster.removeAll();     
         jplMaster = new JPanel(new BorderLayout());
         createCalcButtons();      
         jplMaster.add(jplBackSpace, BorderLayout.WEST);
         jplMaster.add(jplControl, BorderLayout.EAST);
         jplMaster.add(jplButtons, BorderLayout.SOUTH);
         ((JPanel)getContentPane()).revalidate();
         // Add components to frame
         getContentPane().add(jplMaster, BorderLayout.SOUTH);
         jplMaster.setVisible(true);
    private void createCalcButtons() {
         int rows = 4;
         int cols = 5 + calcType/rows;
         jbnButtons = new JButton[31];
         // Create numeric Jbuttons
         for (int i=0; i<=9; i++) {
         // set each Jbutton label to the value of index
         jbnButtons[i] = new JButton(String.valueOf(i));
         // Create operator Jbuttons
         jbnButtons[10] = new JButton("+/-");
         jbnButtons[11] = new JButton(".");
         jbnButtons[12] = new JButton("=");
         jbnButtons[13] = new JButton("/");
         jbnButtons[14] = new JButton("*");
         jbnButtons[15] = new JButton("-");
         jbnButtons[16] = new JButton("+");
         jbnButtons[17] = new JButton("sqrt");
         jbnButtons[18] = new JButton("1/x");
         jbnButtons[19] = new JButton("%");
         jplBackSpace = new JPanel();
         jplBackSpace.setLayout(new GridLayout(1, 1, 2, 2));
         jbnButtons[20] = new JButton("Backspace");
         jplBackSpace.add(jbnButtons[20]);
         jplControl = new JPanel();
         jplControl.setLayout(new GridLayout(1, 2, 2 ,2));
         jbnButtons[21] = new JButton(" CE ");
         jbnButtons[22] = new JButton("C");
         jplControl.add(jbnButtons[21]);
         jplControl.add(jbnButtons[22]);
         //if (calcType == SCIENTIFIC) {     
         jbnButtons[23] = new JButton("s");
         jbnButtons[24] = new JButton("t");
         jbnButtons[25] = new JButton("u");
         jbnButtons[26] = new JButton("v");
         jbnButtons[27] = new JButton("w");
         jbnButtons[28] = new JButton("x");
         jbnButtons[29] = new JButton("y");
         jbnButtons[30] = new JButton("z");
    // Setting all Numbered JButton's to Blue. The rest to Red
         for (int i=0; i<jbnButtons.length; i++)     {
         //activate ActionListener
         System.out.println("add action listener: " + i);
         jbnButtons.addActionListener(this);
         //set button text font/colour
         jbnButtons[i].setFont(f12);
         jbnButtons[i].invalidate();
         if (i<10)
              jbnButtons[i].setForeground(Color.blue);               
         else
              jbnButtons[i].setForeground(Color.red);
         // container for Jbuttons
         jplButtons = new JPanel(new GridLayout(rows, cols, 2, 2));
    System.out.println("Cols: " + cols);      
         //Add buttons to keypad panel starting at top left
         // First row
         // extra left buttons for scientific
         if (calcType == SCIENTIFIC) {
         System.out.println("Adding Scientific buttons");
         setSize(400, 217);
         setLocation(200, 250);
         jplButtons.add(jbnButtons[23]);
         jplButtons.add(jbnButtons[27]);
         } else {
         setSize(241, 217);
         setLocation(200, 250);
         for(int i=7; i<=9; i++)          {
         jplButtons.add(jbnButtons[i]);
         // add button / and sqrt
         jplButtons.add(jbnButtons[13]);
         jplButtons.add(jbnButtons[17]);
         // Second row
         // extra left buttons for scientific
         if (calcType == SCIENTIFIC) {
         System.out.println("Adding Scientific buttons");
         jplButtons.add(jbnButtons[24]);
         jplButtons.add(jbnButtons[28]);
         for(int i=4; i<=6; i++)     {
         jplButtons.add(jbnButtons[i]);
         // add button * and x^2
         jplButtons.add(jbnButtons[14]);
         jplButtons.add(jbnButtons[18]);
         // Third row
         // extra left buttons for scientific
         if (calcType == SCIENTIFIC) {
         System.out.println("Adding Scientific buttons");
         jplButtons.add(jbnButtons[25]);
         jplButtons.add(jbnButtons[29]);
         for( int i=1; i<=3; i++) {
         jplButtons.add(jbnButtons[i]);
         //adds button - and %
         jplButtons.add(jbnButtons[15]);
         jplButtons.add(jbnButtons[19]);
         //Fourth Row
         // extra left buttons for scientific
         if (calcType == SCIENTIFIC) {
         System.out.println("Adding Scientific buttons");
         jplButtons.add(jbnButtons[26]);
         jplButtons.add(jbnButtons[30]);
         // add 0, +/-, ., +, and =
         jplButtons.add(jbnButtons[0]);
         jplButtons.add(jbnButtons[10]);
         jplButtons.add(jbnButtons[11]);
         jplButtons.add(jbnButtons[16]);
         jplButtons.add(jbnButtons[12]);
         jplButtons.revalidate();
    // Perform action
    public void actionPerformed(ActionEvent e){
         double result = 0;
         if(e.getSource() == jmenuitemAbout) {
         //JDialog dlgAbout = new CustomABOUTDialog(this,
         //                              "About Java Swing Calculator", true);
         //dlgAbout.setVisible(true);
         } else if(e.getSource() == jmenuitemExit) {
         System.exit(0);
    if (e.getSource() == jmenuItemNormal) {
    calcType = NORMAL;
    displayCalculator(title);
    if (e.getSource() == jmenuItemScientific) {
    calcType = SCIENTIFIC;
    displayCalculator(title);
    System.out.println("Calculator is set to "
    + (calcType == NORMAL?"Normal":"Scientific") + " :" + jbnButtons.length);      
         // Search for the button pressed until end of array or key found
         for (int i=0; i<jbnButtons.length; i++)     {
         if(e.getSource() == jbnButtons[i]) {
              System.out.println(i);
              switch(i) {
              case 0:
                   addDigitToDisplay(i);
                   break;
              case 1:
                   System.out.println("1");
                   addDigitToDisplay(i);
                   break;
              case 2:
                   addDigitToDisplay(i);
                   break;
              case 3:
                   addDigitToDisplay(i);
                   break;
              case 4:
                   addDigitToDisplay(i);
                   break;
              case 5:
                   addDigitToDisplay(i);
                   break;
              case 6:
                   addDigitToDisplay(i);
                   break;
              case 7:
                   addDigitToDisplay(i);
                   break;
              case 8:
                   addDigitToDisplay(i);
                   break;
              case 9:
                   addDigitToDisplay(i);
                   break;
              case 10:     // +/-
                   processSignChange();
                   break;
              case 11:     // decimal point
                   addDecimalPoint();
                   break;
              case 12:     // =
                   processEquals();
                   break;
              case 13:     // divide
                   processOperator("/");
                   break;
              case 14:     // *
                   processOperator("*");
                   break;
              case 15:     // -
                   processOperator("-");
                   break;
              case 16:     // +
                   processOperator("+");
                   break;
              case 17:     // sqrt
                   if (displayMode != ERROR_MODE) {
                   try {
                        if (getDisplayString().indexOf("-") == 0)
                        displayError("Invalid input for function!");
                        result = Math.sqrt(getNumberInDisplay());
                        displayResult(result);
                   catch(Exception ex) {
                        displayError("Invalid input for function!");
                        displayMode = ERROR_MODE;
                   break;
              case 18:     // 1/x
                   if (displayMode != ERROR_MODE){
                   try {
                        if (getNumberInDisplay() == 0)
                        displayError("Cannot divide by zero!");
                        result = 1 / getNumberInDisplay();
                        displayResult(result);
                   catch(Exception ex) {
                        displayError("Cannot divide by zero!");
                        displayMode = ERROR_MODE;
                   break;
              case 19:     // %
                   if (displayMode != ERROR_MODE){
                   try {
                        result = getNumberInDisplay() / 100;
                        displayResult(result);
                   catch(Exception ex) {
                        displayError("Invalid input for function!");
                        displayMode = ERROR_MODE;
                   break;
              case 20:     // backspace
                   if (displayMode != ERROR_MODE) {
                   setDisplayString(getDisplayString().substring(0,
                   getDisplayString().length() - 1));
                   if (getDisplayString().length() < 1)
                        setDisplayString("0");
                   break;
              case 21:     // CE
                   clearExisting();
                   break;
              case 22:     // C
                   clearAll();
                   break;
    void setDisplayString(String s) {
         jlbOutput.setText(s);
    String getDisplayString () {
         return jlbOutput.getText();
    void addDigitToDisplay(int digit) {
         if (clearOnNextDigit)
         setDisplayString("");
         String inputString = getDisplayString();
         if (inputString.indexOf("0") == 0) {
         inputString = inputString.substring(1);
         if ((!inputString.equals("0") || digit > 0)
                             && inputString.length() < MAX_INPUT_LENGTH) {
         setDisplayString(inputString + digit);
         displayMode = INPUT_MODE;
         clearOnNextDigit = false;
    void addDecimalPoint() {
         displayMode = INPUT_MODE;
         if (clearOnNextDigit)
         setDisplayString("");
         String inputString = getDisplayString();
         // If the input string already contains a decimal point, don't
         // do anything to it.
         if (inputString.indexOf(".") < 0)
         setDisplayString(new String(inputString + "."));
    void processSignChange() {
         if (displayMode == INPUT_MODE) {
         String input = getDisplayString();
         if (input.length() > 0 && !input.equals("0"))     {
              if (input.indexOf("-") == 0)
              setDisplayString(input.substring(1));
              else
              setDisplayString("-" + input);
         } else if (displayMode == RESULT_MODE) {
         double numberInDisplay = getNumberInDisplay();
         if (numberInDisplay != 0)
         displayResult(-numberInDisplay);
    void clearAll() {
         setDisplayString("0");
         lastOperator = "0";
         lastNumber = 0;
         displayMode = INPUT_MODE;
         clearOnNextDigit = true;
    void clearExisting() {
         setDisplayString("0");
         clearOnNextDigit = true;
         displayMode = INPUT_MODE;
    double getNumberInDisplay()     {
         String input = jlbOutput.getText();
         return Double.parseDouble(input);
    void processOperator(String op) {
         if (displayMode != ERROR_MODE) {
         double numberInDisplay = getNumberInDisplay();
         if (!lastOperator.equals("0")) {
              try {
              double result = processLastOperator();
              displayResult(result);
              lastNumber = result;
              catch (DivideByZeroException e)     {
              displayError("Cannot divide by zero!");
         } else {
         lastNumber = numberInDisplay;
         clearOnNextDigit = true;
         lastOperator = op;
    void processEquals() {
         double result = 0;
         if (displayMode != ERROR_MODE){
         try {
              result = processLastOperator();
              displayResult(result);
         catch (DivideByZeroException e) {
              displayError("Cannot divide by zero!");
         lastOperator = "0";
    double processLastOperator() throws DivideByZeroException {
         double result = 0;
         double numberInDisplay = getNumberInDisplay();
         if (lastOperator.equals("/")) {
         if (numberInDisplay == 0)
              throw (new DivideByZeroException());
         result = lastNumber / numberInDisplay;
         if (lastOperator.equals("*"))
         result = lastNumber * numberInDisplay;
         if (lastOperator.equals("-"))
         result = lastNumber - numberInDisplay;
         if (lastOperator.equals("+"))
         result = lastNumber + numberInDisplay;
         return result;
    void displayResult(double result){
         setDisplayString(Double.toString(result));
         lastNumber = result;
         displayMode = RESULT_MODE;
         clearOnNextDigit = true;
    void displayError(String errorMessage){
         setDisplayString(errorMessage);
         lastNumber = 0;
         displayMode = ERROR_MODE;
         clearOnNextDigit = true;
    public static void main(String args[]) {
         Calculator calci = new Calculator("My Calculator");
         calci.displayCalculator("My Calculator");
    System.out.println("Exitting...");
    }     //End of Swing Calculator Class.
    class DivideByZeroException extends Exception{
    public DivideByZeroException() {
         super();
    public DivideByZeroException(String s) {
         super(s);
    class CustomABOUTDialog extends JDialog implements ActionListener {
    JButton jbnOk;
    CustomABOUTDialog(JFrame parent, String title, boolean modal){
         super(parent, title, modal);
         setBackground(Color.black);
         JPanel p1 = new JPanel(new FlowLayout(FlowLayout.CENTER));
         StringBuffer text = new StringBuffer();
         text.append("Calculator Information\n\n");
         text.append("Developer:     Hemanth\n");
         text.append("Version:     1.0");
         JTextArea jtAreaAbout = new JTextArea(5, 21);
         jtAreaAbout.setText(text.toString());
         jtAreaAbout.setFont(new Font("Times New Roman", 1, 13));
         jtAreaAbout.setEditable(false);
         p1.add(jtAreaAbout);
         p1.setBackground(Color.red);
         getContentPane().add(p1, BorderLayout.CENTER);
         JPanel p2 = new JPanel(new FlowLayout(FlowLayout.CENTER));
         jbnOk = new JButton(" OK ");
         jbnOk.addActionListener(this);
         p2.add(jbnOk);
         getContentPane().add(p2, BorderLayout.SOUTH);
         setLocation(408, 270);
         setResizable(false);
         addWindowListener(new WindowAdapter() {
              public void windowClosing(WindowEvent e) {
                   Window aboutDialog = e.getWindow();
                   aboutDialog.dispose();
         pack();
    public void actionPerformed(ActionEvent e) {
         if(e.getSource() == jbnOk) {
         this.dispose();
    Message was edited by:
    dungorg

    Swing related questions should be posted in the Swing forum.
    After adding or removing components from a visible panel you need to use panel.revalidate() and sometimes panel.repaint();
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.

  • Overlapping two JPanels on a JLayeredPane

    I am having some problems overlapping two JPanels on a JLayeredPane for some reason only one of them shows when I compile the program! Any help would be greatly appreciated
    The code is the following:
    import java.lang.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SpaceBall
    //To do the background just draw a JPanel inside another //JPanel just set the opacity of the outside one
    //to false and let
    //it hold all the components of the game
    public static void main(String[] args)
    //declaring the buttons
    JButton test=new JButton("test");
    JButton test1=new JButton("test1");
    JButton test2=new JButton("test2");
    //declaring and setting the properties of the frame
    JFrame SpaceBall= new JFrame("Space Ball");
    SpaceBall.setSize(700,650);
    //declaring the Panels
    JLayeredPane bgPanel= new JLayeredPane();
    JPanel fgPanel= new JPanel();
    JPanel topPanel= new JPanel();
    JPanel sidePanel= new JPanel();
    JPanel lowPanel= new JPanel();
    JPanel masterPanel= new JPanel();
    //adding the buttons to the corresponding panels
    fgPanel.add(test1);
    sidePanel.add(test2);
    topPanel.add(test);
    ImageIcon background= new ImageIcon("images/background.jpg");
    JLabel backlabel = new JLabel(background);
    backlabel.setBounds(0,0,background.getIconWidth(),background.getIconHeight());
    backlabel.add(test1);
    bgPanel.add(backlabel, new Integer(0));
    fgPanel.setOpaque(false);
    bgPanel.add(fgPanel, new Integer(100));
    bgPanel.moveToFront(fgPanel);
    //adding bgPanel and sidePanel to lowPanel
    lowPanel.setLayout(new GridLayout(1,2));
    lowPanel.add(bgPanel);
    lowPanel.add(sidePanel);
    //adding the Panels to the masterPanel
    masterPanel.setLayout(new GridLayout(2,1));
    masterPanel.add(topPanel);
    masterPanel.add(lowPanel);
    //getting the container of SpaceBall and adding the Panels to it
    Container cp=SpaceBall.getContentPane();
    cp.add(masterPanel);
    //displaying everything
    SpaceBall.show();
    WindowListener ClosingTheWindow=new WindowAdapter()
    public void windowClosing(WindowEvent e)
    System.exit(0);
    SpaceBall.addWindowListener(ClosingTheWindow);

    Take a look at the section from the Swing tutorial titled "How to Use Layered Panes". It has a sample program:
    http://java.sun.com/docs/books/tutorial/uiswing/components/layeredpane.html

  • Two JPanels inside another panel should be equal in width

    Hi everybody,
    I have two JPanels which both have a titledborder. I want them to have the same with, but I can not get it done. You can see how it looks here: http://jborsje.nl/jpanels.png. As you can see the JPanels are not equal in width. Here is the code I used (please note that p_hopsControl = true).
         * Initialize the sidebar of the graph panel.
         * @param p_hopsControl Indicates whether or not a widget for controlling the
         * hops in the graph should be added to the panel.
        private JPanel getSideBar(boolean p_hopsControl)
            // Create the panel.
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints constraints = new GridBagConstraints();
            constraints.anchor = GridBagConstraints.FIRST_LINE_START;
            // Add the label and the spinner to the panel.
            constraints.gridx = 0;
            if (!p_hopsControl) constraints.weighty = 1;
            constraints.gridy = 0;
            panel.add(getLegend(), constraints);
            if (p_hopsControl)
                constraints.gridy = 1;
                constraints.weighty = 1;
                constraints.weightx = 1;
                panel.add(getHopsWidgets(), constraints);
            // Set the background of the panel.
            panel.setBackground(m_display.getBackground());
            return panel;
        private JEditorPane getLegend()
            String content = "<html><body>" +
                    "<table>" +
                    "<tr><td bgcolor=\"" + Integer.toHexString(Constants.NODE_COLOR_CLASS & 0x00ffffff) + "\" width=\"20px\"></td><td>OWL class</td></tr>" +
                    "<tr><td bgcolor=\"" + Integer.toHexString(Constants.NODE_COLOR_INDIVIDUAL & 0x00ffffff) + "\"></td><td>OWL individual</td></tr>" +
                    "<tr><td bgcolor=\"" + Integer.toHexString(Constants.NODE_COLOR_SELECTED & 0x00ffffff) + "\"></td><td>Node selected</td></tr>" +
                    "<tr><td bgcolor=\"" + Integer.toHexString(Constants.NODE_COLOR_HIGHLIGHTED & 0x00ffffff) + "\"></td><td>Node highlighted</td></tr>" +
                    "<tr><td bgcolor=\"" + Integer.toHexString(Constants.NODE_COLOR_SEARCH & 0x00ffffff) + "\"></td><td>Node in search result set</td></tr>" +
                    "<tr><td bgcolor=\"" + Integer.toHexString(Constants.NODE_DEFAULT_COLOR & 0x00ffffff) + "\"></td><td>Node in search result set</td></tr>" +
                    "</body></html>";
            JEditorPane legend = new JEditorPane("text/html", content);
            legend.setEditable(false);
            legend.setBorder(new TitledBorder("Legend"));
            JPanel panel = new JPanel();
            panel.setBorder(new TitledBorder("Legend"));
            panel.add(legend);
            return legend;
         * Create a panel containing a JSpinner which can be used to set the number
         * of hops, used in the graph distance filter.
         * @return A JPanel containing the hops widgets.
        private JPanel getHopsWidgets()
            // Get the GraphDistanceFilter.
            GraphDistanceFilter filter = m_display.getDistanceFilter();
            // Create the panel.
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints constraints = new GridBagConstraints();
            constraints.anchor = GridBagConstraints.FIRST_LINE_START;
            // Create the label.
            JLabel label = new JLabel("Number of hops: ");
            // Create the spinner and its model.
            SpinnerNumberModel model = new SpinnerNumberModel(filter.getDistance(), 0, null, 1);
            m_spinner = new JSpinner();
            m_spinner.addChangeListener(this);
            m_spinner.setModel(model);
            // Add the label and the spinner to the panel.
            constraints.gridx = 0;
            constraints.gridy = 0;
            panel.add(label, constraints);
            constraints.gridx = 1;
            constraints.weighty = 1;
            panel.add(m_spinner, constraints);
            // Set the background of the panel.
            panel.setBackground(m_display.getBackground());
            // Add a titled border to the panel.
            panel.setBorder(new TitledBorder("Hops control"));
            return panel;
        }Does anybody know how this can be done?

    Thanks, that solved my issue for the width part. Now the content of the "hops control" panel is centered, althoug I explicitely said "constraints.anchor = GridBagConstraints.FIRST_LINE_START;".
    The update image can still be found here: http://www.jborsje.nl/jpanels.png.

  • How can I send email using two different email address that both link back to my one exchange account on my Ipad mini

    How can I send email using two different email address that both link back to my one exchange account on my Ipad mini? 
    On my PC I simply have a master return email address and use a POP for the secondary address.  Both are through the one exchange account without a problem.  I need to be able to do the same on my Ipad.

    Ah, I should have made that clear.  My domain didn't come from google.  It was purchased at and is hosted at dreamhost, but I haven't used their email servers in years - I just route everything through gmail.  I actually have a bunch of domains (with websites).
    Gmail has an option that lets someone with custom domains send (and receive) email through gmail using the custom domain once Google confirms proper ownership of the domain (to prevent spammers and such).  Gmail has a setting for "send email as" which allows gmail to be sent using a custom domain as the sender.  I'm pretty sure Apple's old mobileme had this feature too, but I didn't use it.

  • How to set up set which NIC card to use for multicast?..

              I just downloaded Rolling Patch 1 for WLS6.0SP2.
              While reading the README file it says
              " ISSUE 42518: Provided a way to set which NIC card to use for multicast traffic
              Can anyone tell me how to set this?. on my WebApplication server it has two NIC
              cards and I want to use the NICcard which is being used to talk to internal network
              for multicast messages.
              One more thing,
              Can anyone one tell how to search for bugs (ISSUES) in weblogic. I am looking
              place where I enter ISSUE number and should get the detailed description of bug/issue
              etc..
              Thanks for helping,
              Nilesh
              

              Thanks Kumar, I'll try this.
              Does this -Dweblogic.interfaceAddress used only for multicast. Or this is also
              used to talk to AdminServer?.
              The other problem I am facing is when I restart the AdminServer in recovery mode
              it's not finding my WebApp servers, because my webapp servers are on public network
              and my admin (management) server is on private network.
              please look at http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.management&item=1217&utag=
              , for more details about my problem.
              Thanks,
              Nilesh
              Kumar Allamraju <[email protected]> wrote:
              ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
              ><html>
              >You should be able to do it via console in 6.1
              ><br>Not sure if it was added in 6.0
              ><p>For 6.0 you can set this via command line
              ><br>java -Dweblogic.interfaceAddress=<addr>
              ><p>You need 6.0 SP2 RP1
              ><p>--
              ><br>Kumar
              ><p>Nilesh Shah wrote:
              ><blockquote TYPE=CITE>I just downloaded Rolling Patch 1 for WLS6.0SP2.
              ><br>While reading the README file it says
              ><br>" ISSUE 42518: Provided a way to set which NIC card to use for multicast
              >traffic
              ><br>"..
              ><p>Can anyone tell me how to set this?. on my WebApplication server it
              >has two NIC
              ><br>cards and I want to use the NICcard which is being used to talk to
              >internal network
              ><br>for multicast messages.
              ><p>One more thing,
              ><p>Can anyone one tell how to search for bugs (ISSUES) in weblogic. I
              >am
              >looking
              ><br>place where I enter ISSUE number and should get the detailed description
              >of bug/issue
              ><br>etc..
              ><p>Thanks for helping,
              ><p>Nilesh</blockquote>
              ></html>
              >
              

  • Purchased a new Apple TV and the remote double clicks each time I press the button. It worked fine during set up and for the first two days.  I have since moved it and this problem started. Restarted,reset,unplugged,change remotes, no change.Help please.

    Purchased a new Apple TV and the remote double clicks each time I press the button. It worked fine during set up and for the first two days.  I have since moved it and this problem started. Restarted,reset,unplugged,changed remotes, no change. Latest software update. This is really annoying.  iPhone remote app works just fine.  Any suggestions?

    That's one of the weird things.. it recognizes it maybe 10% of the time. And usually, only after I do the two-button reset. Problem is.. since it won't charge above 2%, anytime I try to do a restore or anything like that using iTunes, my device shuts off and I lose whatever progress I'd made.
    So, an update... after reading through a bunch of similar complaints (there are literally 1000's of them so there's NO WAY this isn't somehow ios7 related, thanks a lot APPLE ) I decided to try a restore in recovery mode. After 3 hours and several disconnections... I ended up having to just set it up as a new iPad, as the restore did nothing. Weirdly though... as I was doing the restore in recovery mode.. I noticed I'd gotten up to a 10% charge.. higher than it's been since September, so after setting it up as a new device, I turned it off and plugged it in using the wall charger. 2 hours later and I was up to 38%. Still not great, as my iPad, before ios7 could've fully charged twice in the amount of time it took for me to now get 28% more of a charge. And that's with a fully cleaned out device.. so that really ***** and I'm now more confused than ever.
    But I'm gonna leave it overnight charging and see what I come up with tomorrow. Sadly, when I paid $600 for it in February, I never expected to have to play "wait and see" with it...

  • Using two facts of two different star schemas and conformed dimensions

    Hi,
    I've been working as developer and database designer for years and I'm new to Business Objects. Some people says you can not use two facts of two different star schemas in the same query because of conformed dimensions and loop problems in BO.
    For example I have a CUSTOMER_SALE_fACT table containing customer_id and date_id as FK, and some other business metrics about sales. And there is another fact table CUSTOMER_CAMPAIGN_FACT which also contains customer_id and date_id as FK, and some  other business metrics about customer campaigns. SO I have two stars like below:
    DIM_TIME -- SALE_FACT -- DIM_CUSTOMER
    DIM_TIME -- CAMPAIGN_FACT -- DIM_CUSTOMER
    Business metrics are loaded into fact tables and facts can be used together along conformed dimensions . This is one of the fundamentals of the dimensional modeling. Is it really impossible to use SALE_FACT and CAMPAIGN_FACT together? If the answer is No, what is the solution?
    Saying "you cannot do that because of loops" is very interesting.
    Thank you..

    When you join two facts together with a common dimension you have created what is called a "chasm trap" which leads to invalid results because of the way SQL is processed. The query rows are first retrieved and then aggregated. Since sales fact and campaign fact have no direct relationship, the rows coming from either side can end up as a product join.
    Suppose a customer has 3 sales fact rows and 2 campaign fact rows. The result set will have six rows before any aggregation is performed. That would mean that sales measures are doubled and campaign measures are tripled.
    You can report on them together, using multiple SQL passes, but you can't query them together. Does that distinction make sense?

  • How to use two types of fonts in a richtextdocument

    hello,
           i want to print a barcode and some text into  a richtextdocument
    example:
    this.richTextBox1.AppendText("\n");
    Font f1 = new Font("3 of 9 Barcode", 50);
    this.richTextBox1.Font = f1;
    this.richTextBox1.AppendText("*1234554*");
    Font f2 = new Font("Arial", 20);
    this.richTextBox1.Font = f2;
    this.richTextBox1.AppendText("fooo");
    but it always uses the second one?
    how can i resolve this?
    i want to use two types of fonts in the same rich text document.
    thank you very much!!

    Select some text and then set the SelectionFont property for each selection, e.g.:
    this.richTextBox1.AppendText("\n");
    this.richTextBox1.AppendText("*1234554*");
    richTextBox1.SelectionStart = 1;
    richTextBox1.SelectionLength = 9; //End of first word
    richTextBox1.SelectionFont = new System.Drawing.Font("Tahoma", 10);
    this.richTextBox1.AppendText("fooo");
    richTextBox1.SelectionStart = 10;
    richTextBox1.SelectionLength = 4;
    richTextBox1.SelectionFont = new System.Drawing.Font("Arial", 20);
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

Maybe you are looking for

  • Payment Program Output

    I am in asupport prj.I am aware about the payment program and its functionalities and configuration. I am am unaware of how the checks or other payment methods are transffered to outbound interface and their relevant functionality or configuration.Ac

  • InDesign CS6 and OpenGL 1.5 / image frames grey out in INDML

    Hi everyone, I work for a non-profit and I just upgraded to InDesign CS6 on my (signifcantly more robust) machine. Now thier (significantly wimpier) machine needs to be upgraded too as we send INDD files back and forth on a monthly basis, and both si

  • Rotate external display

    How can i rotate my external display?  When i use the command-option key i get the option to rotate my i mac display but not my external display.

  • Panning the screen of your 12" monitor

    Panning is the ability to set your desktop bigger than your actually monitor. (e.g. PB 12" is 1024x768, but you set the desktop to say, 1680x1050). You can only see 1024 at a time, but with the mouse, you slide the view to different parts of the 1680

  • Report on Invoiced items

    Hi there I am in urgent need for a report to be run at day end which states all Invoiced Items and Credit memos - Thank you Rukshana