Urgent!!!!!!!! JFrame+JPanel problem

How can I add a JFrame to a JPanel? What kind of objects can be contained Frames in at all?
Thanks in advance

Hi
You cant add JFrame,JWindow,JApplet,JDialog to any other component.
These are top level component and can not be added to any other.
Ashish

Similar Messages

  • Urgent- Printing JPanel problem

    I want to print a JPanel by calling a Print utility class. JPanel is drawing with different shapes (Rectangle2D etc..)
    The problem is that I can only print the first page of the JPanel.
    My Print utility:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.print.*;
    public class PrintUtilities {
    private Component componentToBePrinted;
    public static void printComponent(Component c) {
    new PrintUtilities(c).print();
    public PrintUtilities(Component componentToBePrinted) {
    this.componentToBePrinted = componentToBePrinted;
    public void print() {
    PrinterJob printJob = PrinterJob.getPrinterJob();
    BookComponentPrintable printable1 = new BookComponentPrintable(componentToBePrinted);
    PageFormat pageFormat1 = printJob.pageDialog(printJob.defaultPage());
    Book book = new Book();
    book.append(printable1, pageFormat1);
    // Print the Book.
    printJob.setPageable(book);
    if (printJob.printDialog())
    try {
    printJob.print();
    } catch(PrinterException pe) {
    System.out.println("Error printing: " + pe);
    class BookComponentPrintable
    implements Printable {
    private Component mComponent;
    public BookComponentPrintable(Component c) {
    mComponent = c;
    public int print(Graphics g, PageFormat pageFormat, int pageIndex) {
    if (pageIndex > 0) {
    return(NO_SUCH_PAGE);
    else
    Graphics2D g2 = (Graphics2D)g;
    g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    mComponent.paint(g2);
    return Printable.PAGE_EXISTS;
    What did I do wrong? Thanks in advance !!!

    Oh... it's just a mistake because of copy and paste.
    I did also have these code (without if (pageIndex > 0) {
    return(NO_SUCH_PAGE); ) but with these
    /* calculate the no. of pages to print */
    int totalNumPages = (int)Math.ceil((panelHeight) /
    height );
    if (pageIndex >= totalNumPages) return NO_SUCH_PAGE;
    and when I use :
    System.out.println("totalNumPages: " + String.valueOf(totalNumPages));
    I can see at there are two pages. But when it prints it can only print one. So...

  • JFrame/JPanel Problem

    Hi all,
    I'm having trouble chaging the backgound color of my JFrame. It contains a JList.
    MY Code:
    panel.setBackground(Color.black);
    Please help. Thanks

    What is panel? Is it your JFrame? I think you need to do getContentPane().setBackgroundColor()

  • JFrame Repaint problem

    I am new to Java Swing and I have a problem.
    I have a GUI program which extends JFrame and contains some business logic. In the middle of executing the business logic, I need to display a chart and I used another JFrame to display the chart. The chart did display but once the control return back to the original process, the chart Jframe turn blank. How can I get the display of the chart until user closes it?
    public class ChangeMetric extend JFrame implements ActionListener {
    public void actionPerformed(ActionEvent event) {
    JFrame jf = new JFrame();
    JPanel jp = new JPanel();
    jp.setSize(500,500);
    jf.getContentPane().add(jp);
    jf.setVisible(true);
    JOptionPane.showConfirmDialog(null, "Report has been saved to : " + path + "\n " +
                   "Do you want another report?", "Completed", JOptionPane.YES_NO_OPTION);
    //Jf turn blank after the JoptionPane displayed.
    Thanks in advance.
    Alex

    I need to display a chart and I used another JFrame to display the chart.An application should only have a single JFrame. Use a JDialog instead. You create it the same way you do a JFrame, the only difference is you specify the frame as the owner.
    Jf turn blank after the JoptionPane displayed.Then you must be doing something really wierd in your code. There is no reason for the option pane to have any effect on your dialog.
    And when you post your SSCCE, don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • How to force to wait and get input from a jframe-jpanel?

    I would like to use a jframe-jpanel to get user input instead of using JOptionPane.showInputDialog since there will be more than 1 input.
    But I could not do it. The code reads the panel lines and passes to other lines below without waiting for the okay button to be pressed.
    This is the part of code of my main frame;
    jLabel10.setText(dene.toString());
    if (dene == 0) {
    // todo add button input panel
    //String todo_write = JOptionPane.showInputDialog("Please enter a todo item");
    JFrame frameTodoAddInput = new JFrame( "Please input..." );
    TodoAddAsk1JPanel todoaddpanel = new TodoAddAsk1JPanel();
    frameTodoAddInput.add(todoaddpanel);
    frameTodoAddInput.setSize( 600, 200 ); // set frame size
    frameTodoAddInput.setLocation(300, 300);
    //String todo_write = todoaddpanel.getNewTodoItem();
    String todo_write = todoaddpanel.getNewTodoItem();
    jLabel10.setText("Satir 1822 de".concat(todo_write));
    // end of todo add button input panel
    todoTextPane1.setText(todo_write);
    This is the code of input panel;
    * TodoAddAsk1JPanel.java
    * Created on May 6, 2007, 12:03 AM
    package javaa;
    public class TodoAddAsk1JPanel extends javax.swing.JPanel {
    /** Creates new form TodoAddAsk1JPanel */
    public TodoAddAsk1JPanel() {
    initComponents();
    private String NewTodoItem = "";
    public String getNewTodoItem() {
    NewTodoItem = ANewTodoItemTextField.getText();
    return this.NewTodoItem;
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    jLabel1 = new javax.swing.JLabel();
    ANewTodoItemTextField = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    PriorityComboBox = new javax.swing.JComboBox();
    jLabel3 = new javax.swing.JLabel();
    DayValueComboBox = new javax.swing.JComboBox();
    MonthValueComboBox = new javax.swing.JComboBox();
    YearValueComboBox = new javax.swing.JComboBox();
    OkayButton = new javax.swing.JButton();
    CancelButton = new javax.swing.JButton();
    TimeValueComboBox = new javax.swing.JComboBox();
    jLabel1.setText("Please enter a todo item:");
    jLabel2.setText("Please select its priority level:");
    PriorityComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "A", "B", "C" }));
    jLabel3.setText("Please select its due date:");
    DayValueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));
    MonthValueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }));
    YearValueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025", "2026", "2027", "2028", "2029", "2030", "2031", "2032", "2033", "2034", "2035", "2036", "2037", "2038", "2039", "2040", "2041", "2042", "2043", "2044", "2045", "2046", "2047", "2048", "2049", "2050", "2051", "2052", "2053", "2054", "2055", "2056", "2057", "2058", "2059", "2060", "2061", "2062", "2063", "2064", "2065", "2066", "2067", "2068", "2069", "2070" }));
    OkayButton.setText("OK");
    OkayButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    OkayButtonActionPerformed(evt);
    CancelButton.setText("Cancel");
    TimeValueComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00", "18:30", "19:00", "19:30", "20:00", "20:30", "21:00", "21:30", "22:00", "22:30", "23:00", "23:30", "00:00", "00:30", "01:00", "01:30", "02:00", "02:30", "03:00", "03:30", "04:00", "04:30", "05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00" }));
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)
    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(PriorityComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(ANewTodoItemTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 279, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(OkayButton, javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 133, Short.MAX_VALUE)
    .addComponent(CancelButton))
    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
    .addComponent(DayValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(MonthValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
    .addComponent(YearValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
    .addGap(13, 13, 13)
    .addComponent(TimeValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGap(42, 42, 42)))
    .addContainerGap())
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(ANewTodoItemTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jLabel1))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jLabel2)
    .addComponent(PriorityComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jLabel3)
    .addComponent(DayValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(MonthValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(YearValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(TimeValueComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGap(18, 18, 18)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(OkayButton)
    .addComponent(CancelButton))
    .addContainerGap())
    }// </editor-fold>
    private void OkayButtonActionPerformed(java.awt.event.ActionEvent evt) {                                          
    // TODO add your handling code here:
    NewTodoItem = ANewTodoItemTextField.getText();
    // Variables declaration - do not modify
    private javax.swing.JTextField ANewTodoItemTextField;
    private javax.swing.JButton CancelButton;
    private javax.swing.JComboBox DayValueComboBox;
    private javax.swing.JComboBox MonthValueComboBox;
    private javax.swing.JButton OkayButton;
    private javax.swing.JComboBox PriorityComboBox;
    private javax.swing.JComboBox TimeValueComboBox;
    private javax.swing.JComboBox YearValueComboBox;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    // End of variables declaration
    I want to get the resulted input of "NewTodoItem"
    Thanks in advance for your kind help.
    Guven

    Thank you very much for your help. But I would like
    to get 3 inputs from 1 window at the same time and I
    could not find any example code for JDialog for more
    than 1 input. If any body can show how to write this
    code, it would be appreciated.
    ThanksYou can write your own. A JDialog is a container just look a JFrame is.

  • Problem with JFrame, JPanel and getInsets()...

    hi, this is my problem:
    I have a JFrame and I want add a JPanel to its ContentPan, I need to know the JFrame's getInsets values to set (with setBounds()) the right dimensions of the JPanel, but if I call getInsets() before of setVisible(true) I obtain all 0 values, if I call setVisible(true) before of add() I obtain the right values, but the JPanel is not showed.
    By now I have solved with this sequence:
    new panel();
    contpan.add(panel);
    getInsets();
    panel.setBounds();but I would pass the bounds values to my panel constructor, something like this:
    new panel(getInsets(););
    contpan.add(panel);Could someone help me?

    I have just found this post:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=302473
    And the first way seems to be the only way to solve the problem... :(
    Now the question is, does it exist a way to refresh a JFrame after that I have uset setVisible(true)?
    If it does exist I could have something like this:
    setVisible(true)
    new panel(getInsets(););
    contpan.add(panel);
    REFRESH();

  • GUI Problem (Swing JFrame/JPanel). HELP!

    Hi,
    I made an small application for calculate some things.
    I download i piece of code for creating bar chart and i icluded in my code. But i have problem when i am trying to show the chart in the Frame. All the buttons, textfields, labels goes to left and half are hiding.
    If i open the chart on a new frame i dont have problem.
    the problem apears when after i put the panel in the frame i try to put the chart in the frame. Look the code:
    add(p);     //Put the panel in the Frame
    this.getContentPane().add(new ChartPanel(values, names, "Fertilizer Plant")); // <-- The problem!!that command mades me the problem!
    Here are 2 screenshots
    1. When i put the chart in the Frame (the problem)
    http://www.iweb.gr/images/InFrame.jpg
    2. When i put the chart on new frame (works fine)
    http://www.iweb.gr/images/NewFrame.jpg
    Hopes someone can help. Thanks
    The code List:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    //The main class of the program
    public class PlantFertilizer  extends JFrame{//The main class is a subclass of Frame
         private Label lN, lP,lK;//These show the value of the observable
         public TextField tN, tP, tK;
         private MyData thedata;//The observable we are going to watch
         private double[] values=new double[3];
        private String[] names=new String[3];
        private String title;
    public PlantFertilizer(){
         thedata=new MyData();// create the observable
         addWindowListener(new WindowAdapter(){//if user closes the Frame, quit
              public void windowClosing(WindowEvent e){
                   System.exit(0);
         setSize(400,500);//Set size
         setTitle(getClass().getName()+" By Pantelis Stoumpis");
         JPanel p = new JPanel();    //Make a panel for buttons and output
         //Input Data Area
         p.add(new Label("-------------------------Input Data Area--------------------------",Label.CENTER));
         p.add(new Label("Nitrogen (N)"));
         tN = new TextField();p.add(tN);
         p.add(new Label("Phosphorus (P)"));
         tP = new TextField();p.add(tP);
         p.add(new Label("Potassium (K)"));
         tK = new TextField();p.add(tK);
         lN=new Label("N = %", Label.CENTER);
         p.add(lN);     //Put the N label in the panel
         lP=new Label("P = %", Label.CENTER);
         p.add(lP);          //Put the P label in the panel
         lK=new Label("K = %", Label.CENTER);
         p.add(lK);          //Put the K label in the panel
         addButton(p,"Apply",          //Apply new Values
         new ActionListener(){
         public void actionPerformed(ActionEvent evt){
              int iNt = Integer.parseInt(tN.getText());
              int iPt = Integer.parseInt(tP.getText());
              int iKt = Integer.parseInt(tK.getText());
              thedata.addOne(iNt,iPt,iKt);          //which adds one to the observable
              JFrame f = new JFrame();
             f.setSize(400, 300);
              values[0] = 40;
             names[0] = "N";
             values[1] = 20;
             names[1] = "P";
             values[2] = 30;
             names[2] = "K";
             f.getContentPane().add(new ChartPanel(values, names, "Fertilizer Plant"));
              f.setVisible(true);
         addButton(p,"Close",          //add a close button to quit the program
         new ActionListener(){
         public void actionPerformed(ActionEvent evt){
              System.exit(0);
    add(p);     //Put the panel in the Frame
    this.getContentPane().add(new ChartPanel(values, names, "Fertilizer Plant")); // <-- The problem!!
    //A utility function to add a button with a given title and action
    public void addButton(Container c, String title,ActionListener a)
              Button b=new Button(title);
              c.add(b);
              b.addActionListener(a);
    public class ChartPanel extends JPanel {
      private double[] values;
      private String[] names;
      private String title;
      public ChartPanel(double[] v, String[] n, String t) {
        names = n;
        values = v;
        title = t;
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (values == null || values.length == 0)
          return;
        double minValue = 0;
        double maxValue = 0;
        for (int i = 0; i < values.length; i++) {
          if (minValue > values)
    minValue = values[i];
    if (maxValue < values[i])
    maxValue = values[i];
    //Dimension d = getSize();
    //int clientWidth = d.width;
    //int clientHeight = d.height;
    //int barWidth = clientWidth / values.length;
    //Dimension d = 100;
         int clientWidth = 100;
         int clientHeight = 150;
    int barWidth = clientWidth / values.length;
    Font titleFont = new Font("SansSerif", Font.BOLD, 12);
    FontMetrics titleFontMetrics = g.getFontMetrics(titleFont);
    Font labelFont = new Font("SansSerif", Font.PLAIN, 10);
    FontMetrics labelFontMetrics = g.getFontMetrics(labelFont);
    int titleWidth = titleFontMetrics.stringWidth(title);
    int y = titleFontMetrics.getAscent();
    int x = (clientWidth - titleWidth) / 2;
    g.setFont(titleFont);
    g.drawString(title, 10, 300);
    int top = titleFontMetrics.getHeight();
    int bottom = labelFontMetrics.getHeight();
    if (maxValue == minValue)
    return;
    double scale = (clientHeight - top - bottom) / (maxValue - minValue);
    y = clientHeight - labelFontMetrics.getDescent();
    g.setFont(labelFont);
    for (int i = 0; i < values.length; i++) {
    int valueX = i * barWidth + 1;
    int valueY = top;
    int height = (int) (values[i] * scale);
    if (values[i] >= 0)
    valueY += (int) ((maxValue - values[i]) * scale);
    else {
    valueY += (int) (maxValue * scale);
    height = -height;
    g.setColor(Color.red);
    g.fillRect(valueX, valueY, barWidth - 2, height);
    g.setColor(Color.black);
    g.drawRect(valueX, valueY, barWidth - 2, height);
    int labelWidth = labelFontMetrics.stringWidth(names[i]);
    x = i * barWidth + (barWidth - labelWidth) / 2;
    g.drawString(names[i], x, y);
    //main is called when we start the application
    public static void main(String[]args){
                   PlantFertilizer od = new PlantFertilizer();//make an observationsDemo frame
                   NWatcher watchitN = new NWatcher(od.lN);//make an observer
                   od.thedata.addObserver(watchitN);//register observer with the observable
                   PWatcher watchitP = new PWatcher(od.lP);//make an observer
                   od.thedata.addObserver(watchitP);//register observer with the observable
                   KWatcher watchitK = new KWatcher(od.lK);//make an observer
                   od.thedata.addObserver(watchitK);//register observer with the observable
                   od.setVisible(true);//show the frame on the screen

    Why are you putting Labels and TextFields (heavyweight AWT components) into a lightweight JPanels?
    What's the first rule of Swing? DO NOT MIX heavyweight AWT components and lightweight Swing components. Period. Never.
    There's Swing equivalents for every single AWT component, and then some. There's no excuse for not using them.
    However, if this chart library code is AWT based, then you should make a completely AWT based UI. Or find a different library based on Swing (like JFreeChart).
    And finally:
    add(p);     //Put the panel in the Frame
    this.getContentPane().add(new ChartPanel(values, names, "Fertilizer Plant")); // <-- The problem!!is wrong....
    add(p);      // <-- The problem!!
    this.getContentPane().add(new ChartPanel(values, names, "Fertilizer Plant"));You don't call add on JFrame or JDialog to add things to it, unless you know what you're doing. And you clearly don't, else you wouldn't have done it. What you probably want to do is this:
    this.getContentPane().add(p, BorderLayout.SOUTH);
    this.getContentPane().add(new ChartPanel(values, names, "Fertilizer Plant"), BorderLayout.CENTER);

  • JFrame restoration problem.

    Hello everyone!!
    My problem is:
    I have a jframe inside of that there's a jpanel.
    the jpanel mouse listener calls a method in a different class that uses the graphic reference of the jpanel to draw. once I minimize and maximize the jframe the drawing disappear. once I click on the area where drawing used to be it appears again.
    I have an inner window listener class in the jframe which calls the same method in the same instance of the other class but nothing happens until I click on the area on the mouse listener calls the method!!
    please help.

    Go through ths tutorial:
    The Java&#8482; Tutorials: [Performing Custom Painting|http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html]
    After that, if you still have a question, post a SSCCE that clearly demonstrates the problem.
    db

  • Paint JPanel problem

    Hi All
    I have 2 classes
    class1. has a Jframe with a JPanel.
    class1 2. A Has a JPanel called contact
    I am calling class2 from class1.
    It is placing the the contact Panel onto the JPanel in class1 but does not show. If I resize class1 it the shows that it is there.
    I have tried repaint(); with out any luck
    any other help would be helpfull
    Thanks
    Craig

    Ok Here you go
    I have class1 witch is my main frame called Command class
    I have a menu class that has a jTree on it called Menu_Panel
    Then I have a class called DataClient which is the panel that I am have Problems with.
    Here is the Code
    This is the jbInit in the Command Class.
        mainPanel.setLayout(borderLayout3);
        mainPanel.setLayout(borderLayout4);
        topPanel = new Panel_Top();
        mainPanel.add(topPanel, BorderLayout.NORTH);
        menuPanel = new Menu_Panel();
        dataPanel = new DataPanel();
        setMenuItems();
        contentPane = (JPanel)this.getContentPane();
        contentPane.setLayout(borderLayout1);
        this.setSize(new Dimension(900, 600));
        this.setTitle("Frame Title");
        jMenuFile.add(jMenuFileExit);
        jMenuHelp.add(jMenuHelpAbout);
        jMenuBar1.add(jMenuFile);
        jMenuBar1.add(jMenuHelp);
        contentPane.add(mainPanel, BorderLayout.CENTER);
        mainPanel.add(menuPanel, BorderLayout.WEST);
        mainPanel.add(topPanel, BorderLayout.NORTH);
        mainPanel.add(dataPanel, BorderLayout.CENTER);
        mainPanel.revalidate();
        this.setJMenuBar(jMenuBar1);
        fontResize();
        menuPanel.setDataPanel(dataPanel);   // This is where the Menu_Panel calls the show of DataPanel This is from the Menu_Panel at which point fires the menuPanel.setDataPanel(dataPanel); in the Command Class.
    /** Required by TreeSelectionListener interface. */
      public void valueChanged(TreeSelectionEvent e) {
        DefaultMutableTreeNode node = (DefaultMutableTreeNode)
            tree.getLastSelectedPathComponent();
        if (node != null) {
          fromMenu = tree.getLastSelectedPathComponent().toString();
          checkMenuNames ();
    public void checkMenuNames (){
      if(fromMenu.equals("Client")){
              dataPanel.showClient();
    }This is the DataPanel Class
    public class DataPanel
        extends JPanel {
      private DataClient dataClient;
      public void showClient() {
        //  dClient = new Data_Client();
    if (dataClient == null){
      System.out.println("This worked");
    dataClient = new DataClient();
    this.add(dataClient);
    }and this is the DataClient class
    public class DataClient  extends JPanel{
      XYLayout xYLayout1 = new XYLayout();
      JLabel jLabel1 = new JLabel();
      public DataClient() {
        try {
          jbInit();
        catch(Exception e) {
          e.printStackTrace();
      private void jbInit() throws Exception {
        jLabel1.setText("This is Client");
        this.setLayout(xYLayout1);
        this.add(jLabel1,    new XYConstraints(110, 95, 179, -1));
    }Hope you can help me :)
    Craig

  • URGENT: Heap space problems with image resizing

    I'm creating a Swing program, with an InternalFrame-type interface. One of the frames contains a .gif file background and then primitive G2D objects are drawn on top of it.
    The background image loads and displays fine at its original size, but I've added code for when the window resizes, and resizing the image causes the VM to give me an OutOfMemory exception.

    I tried this without any problem (with a gif of 137 kb):
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ImageFrame extends JFrame {
        public ImageFrame() {
            initComponents();
            Toolkit T=this.getToolkit();
            im0=T.getImage("C:\\sophie.gif");
            MediaTracker mediaTracker = new MediaTracker(this);
            mediaTracker.addImage(im0, 1);
            try {
                mediaTracker.waitForID(1);
            } catch (InterruptedException ie) {
                System.err.println(ie);
            jInternalFrame1.add(new MyPanel());
        private void initComponents() {
            jDesktopPane1 = new JDesktopPane();
            jInternalFrame1 = new JInternalFrame();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            jInternalFrame1.setResizable(true);
            jInternalFrame1.setVisible(true);
            jInternalFrame1.addComponentListener(new ComponentAdapter() {
                public void componentResized(ComponentEvent evt) {
                    jInternalFrame1ComponentResized(evt);
            jInternalFrame1.setBounds(0, 0, width, height);
            jDesktopPane1.add(jInternalFrame1, JLayeredPane.DEFAULT_LAYER);
            getContentPane().add(jDesktopPane1, BorderLayout.CENTER);
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-800)/2, (screenSize.height-500)/2, 800, 500);
        private void jInternalFrame1ComponentResized(ComponentEvent evt) {
            width=jInternalFrame1.getWidth();
            height=jInternalFrame1.getHeight();
        public static void main(String args[]) {
            new ImageFrame().setVisible(true);
        private int width=500,height=300;
        private Image im0;
        private JDesktopPane jDesktopPane1;
        private JInternalFrame jInternalFrame1;
        class MyPanel extends JPanel {
            public void paint(Graphics g1) {
                g1.drawImage(im0,0,0,width,height,this);
                g1.dispose();
    }

  • URGENT:RTFEditorKit  FontSize Problem , PLEASE HELP

    Hi all,
    I 'm using a JEditorPane and RTFEditorKit for showing a saved RTF File in my Swing application. The
    The problem is that the font size appearing on EditorPane is smaller than that appears when I open the same file in MS Word. I had posted this problem earlier to which I got replies that similar problem occurs
    for HTMLEditorKit. Has anybody encountered this problem for RTF. I'm running my application
    on win2k with j2sdk1.4.1_05. PLEASE LET ME KNOW IF ANYBODY HAS SOLVED THIS PROBLEM.

    never say die,
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    public class DoTheComboBoxThing extends JFrame {
          public DoTheComboBoxThing() {
          initCompponents();
          public void initCompponents() {
          jcb1 = new JComboBox(states);
          jcb2 = new JComboBox(state_ab);
          jp = new JPanel();
          jp.add(jcb1);
          jp.add(jcb2);
          getContentPane().add(jp, BorderLayout.CENTER);
          addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent we) {
                   exitForm(we);
          jcb1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                   jcb1ActionPerformed(ae);
          pack();
          public void exitForm(WindowEvent we) {
          System.exit(0);
          public void jcb1ActionPerformed(ActionEvent ae) {
          jcb2.setSelectedIndex(jcb1.getSelectedIndex());
          jcb1.setEditable( true );
          StringTokenizer st = new StringTokenizer( (String) jcb1.getSelectedItem(), " " );
          ( (JTextField) jcb1.getEditor().getEditorComponent() ).setEditable( true );
          ( (JTextField) jcb1.getEditor().getEditorComponent() ).setText( st.nextToken() );
          ( (JTextField) jcb1.getEditor().getEditorComponent() ).setEditable( false );
          public static void main(String [] args) {
          DoTheComboBoxThing doThe = new DoTheComboBoxThing();
          doThe.show();
          JPanel jp;
          JComboBox jcb1;
          JComboBox jcb2;
          String[] states = {"AL - Alabama", "CT - Connecticut", "NY - New York", "SATW - Sleeping at the wheel"};
          String[] state_ab = {"AL","CT","NY","SATW"};
          }

  • A strange JPanel problem

    i have a JPanel which have a picture as a background the problem is when i wnat to add a JLabel or JTextField into this JPanel it didnt word but it works for labels bat JLabels no???why??
    here u are the code
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    public class d extends Container
        JTextField text1,text2,text3,text4,text5,text6;
         ImageIcon icon ;
       public d()
    {  super();
       setLayout(null );                                                                         
        setBackground(Color.RED);                                                                                                 
        text1=new JTextField();
       text2=new JTextField();
       text3=new JTextField();
       text4=new JTextField();
       text5=new JTextField();
        text6=new JTextField();
        panel p=new panel();
       p.setBounds(10,10,500,500);
         p.setLayout(null);
         p.setOpaque(true);
    p.setBackground(Color.WHITE);
    text1.setBounds(160,30,100,20);
    p.add(text1);
    text2.setBounds(10,30,100,20);
      p.add(text2);
      text3.setBounds(300,30,100,20);
      p.add(text3);
      text4.setBounds(10,100,100,20);
      p.add(text4);
    text5.setBounds(160,100,100,20);
      p.add(text5);
      text6.setBounds(300,100,100,20);
      p.add(text6);
    JLabel l1=new JLabel("touti");
    l1.setBackground(Color.WHITE);
      l1.setBounds(10,10,80,15);
      add(p);
       class panel extends JPanel
           public  void paint(Graphics g) {
           super.paint(g);
           icon=new ImageIcon("c:/bachir.jpg");
            g.drawImage(icon.getImage(),0,0, this);
    public static void main(String args[])
       JFrame frm = new JFrame( "test panel back ground" );
            frm.setBounds( 100, 100, 800, 800 );
            frm.getContentPane().setLayout( new BorderLayout() );
        d pnl=new d();
            frm.getContentPane().add(pnl , BorderLayout.CENTER );
      frm.setIconImage(Toolkit.getDefaultToolkit().getImage("c:/java/oicon.gif"));
            frm.setVisible( true );
    }

    You seem to be mixing AWT and Swing. You should use all AWT or all Swing but not a mixture. Try changing
    public class d extends Container
    to
    public class d extends JPanel.
    P.S. Your choice of class name stinks! It does not describes the role the class plays and it does not meet the Sun recommended coding standards.
    Message was edited by:
    sabre150

  • Undecorated jframe resize problem

    i created a custom jframe look by setting a jframe to undecorated and designing my own maximize/minimize/close buttons and other things to improve its appearence
    the problem is that when set to undercorated all the default resizing/move methods are gone
    i tried implementing my own resize methods, they seem to work but it flashes like crazy while resizing
    anyone have any idea how to stop all the flashing or a better way to implement this?
    the following is a small example of the problem i am having, i only implemented the north resize part so the code can be easier to read.
    thnx in advance
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.imageio.*;
    import java.io.*;
    import java.awt.image.BufferedImage;
    public class TestFrame extends JFrame implements MouseMotionListener, MouseListener
         Point sp;
         int     compStartHeight;
         int minHeight = 100;
         JPanel frameContent = new JPanel();
         public TestFrame()
              super("testing frame");
              setSize(600, 600);
              setContentPane(frameContent);
              frameContent.setBackground(Color.black);
              frameContent.setLayout(new BoxLayout(frameContent, BoxLayout.Y_AXIS));     
              setUndecorated(true);
              addMouseMotionListener(this);
              addMouseListener(this);
              JButton testButton = new JButton("TEST");
              JButton testButton2 = new JButton ("TEST2");
              frameContent.add(testButton);
              frameContent.add(Box.createVerticalGlue());
              frameContent.add(testButton2);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setVisible(true);
         public void mouseMoved(MouseEvent e)
              Point p = e.getPoint();
              if (p.y > e.getComponent().getSize().height - 5)
                   setCursor( Cursor.getPredefinedCursor( Cursor.N_RESIZE_CURSOR ));
              else
                   setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR));
         public void mouseDragged(MouseEvent e)
              Point p = e.getPoint();
              int compWidth = getSize().width;
              if (getCursor().getType() == Cursor.N_RESIZE_CURSOR)
                   int nextHeight = compStartHeight+p.y-sp.y;
                   if (nextHeight > minHeight)
                        setSize(compWidth,nextHeight);
                        validate();
              else
                   int x = getX()+p.x-sp.x;     
                   int y = getY()+p.y-sp.y;     
                   setLocation(x,y);
         public void mousePressed(MouseEvent e)
              sp = e.getPoint();
              compStartHeight = getSize().height;
         public void mouseEntered(MouseEvent e)
        public void mouseExited(MouseEvent e)
              if (sp == null)
                   setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR));
        public void mouseClicked(MouseEvent e)
        public void mouseReleased(MouseEvent e)
              sp = null;
         public static void main(String[] args)
         new TestFrame();
    }

    I doubt there is a faster / easier way to resize.
    Have you tried adding
    public boolean isDoubleBuffered()
      return true;
    }To over-ride Component.isDoubleBuffered. This should sort out your flickering problem.
    Bamkin

  • Unexplained JFrame loading problems

    I keep getting a problem whenever i try and use a window that i extended off of JFrame. By its self the frame works perfectly, but when i actually try to use it for the purpose intended, the winow pops up, and is in the right spot, but nothing i put in it is visible. Any ideas?
    The class in question is called "PassFrame". It runs into the problem on lines 239-240 where i try to use it.
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Secrecy {
         private int[] code;
         private int[] cipher;
         private Dice dice;
         private GUI gui;
         private PassFrame passframe;
         public static final char SPACE = ' ';
         //if encrypting, crypt is true, decrypting, crypt is false
         //crypt is set to true by default
         boolean crypt = true;
         public Secrecy() {
              code = new int[93];
              cipher = new int[93];
              dice = new Dice(93);
         void setUp() {
              for(int i = 0; i < code.length; i++) {
                   code[i] = 32+i;
                   code[i] = -1;
         public void setSeed(char[] c) {
              dice.setSeed(seedSetter(c));
         public int seedSetter(char[] pass) {
              int i = 0;
              for(int j = 0; j < pass.length; j++) {
                   i += (int)pass[j];
              return i;
         static void frameWait(JFrame frame) {
              while(frame.isVisible()) {
                   nap(100);
         static void fileChooserWait(JFileChooser chooser) {
              while(chooser.isVisible()) {
                   nap(100);
         void generateCipher() {
              for(int i = 0; i < cipher.length; i++) {
                   int go = dice.roll();
                   if(cipher[go] == -1) {
                        cipher[go] = code;
         //takes input string and converts it using substitution of a different char sequence, then returns converted string
         String encrypt(String s) {
              String now = "";
              for(int i = 0; i < s.length(); i++) {
                   char c = s.charAt(i);
                   now += findMatch(c, crypt);
              return now;
         //looks through one char array to find a match of input char'c', returns corresponding char in different char array
         public int findMatch(char c, boolean b) {
              if(b) {
                   for(int j = 0; j < code.length; j++) {
                        if((int)c == code[j]) {
                             return cipher[j];
              }else{
                   for(int j = 0; j < cipher.length; j++) {
                        if((int)c == cipher[j]) {
                             return code[j];
              return (int)SPACE;          
         void runEncryption(JTextArea area, char[] password) {
              setSeed(password);
              String now = encrypt(area.getText());
              area.setText(now);
         static void nap(int ms) {
              try{
                   Thread.currentThread().sleep(ms);
              }catch (InterruptedException ivt) {
         static void center(JFrame frame) {
              Toolkit tk = Toolkit.getDefaultToolkit();
              Dimension d = tk.getScreenSize();
              frame.setLocation((d.width/2) - (frame.getWidth()/2), (d.height/2) - (frame.getHeight()/2));
         void runChooser() {
              ChooserFrame chooser = new ChooserFrame();
              fileChooserWait(chooser);
         void runPass(JTextArea area) {
              passframe.show();
              while(passframe.isVisible()) {
                   nap(100);
              char[] c = passframe.getPassword();
              setSeed(c);
              generateCipher();
              encrypt(area.getText());
         void run() {
              gui = new GUI(this);
              gui.show();
         public static void main(String[] args) {
              Secrecy sec = new Secrecy();
              sec.run();
    class PassFrame extends JFrame {
         private int length = 16;
         private char[] password;
         private JLabel label = new JLabel("Please enter your Password");
         private JPasswordField jpf = new JPasswordField(length);
         private JPanel panel = new JPanel();
         public PassFrame() {
              setTitle("Password");
              setResizable(false);
              panel.add(label);
              jpf.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent kvt) {
                        int code = kvt.getKeyCode();
                        if(code == KeyEvent.VK_ENTER) {
                             password = jpf.getPassword();
                             hide();
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent evt) {
                        WindowCloser wc = new WindowCloser();
              panel.add(jpf);
              getContentPane().add(panel);
              pack();
              Secrecy.center(this);
         public char[] getPassword() {
              return password;
         void run() {
              Secrecy.center(this);
              show();
              Secrecy.frameWait(this);
              if(password != null) {
                   System.out.println(password);
         public static void main(String[] args) {
              PassFrame pf = new PassFrame();
              pf.run();
    class ChooserFrame extends JFileChooser {
         public ChooserFrame() {
    class GUI extends JFrame {
         private JButton encrypt;
         private JButton open;
         private JTextArea area;
         private JPanel panel;
         private JScrollPane pane;
         private Secrecy prog;
         public GUI(Secrecy sec) {
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent evt) {
                        WindowCloser wc = new WindowCloser();
              prog = sec;
              encrypt = new JButton("Encrypt");
              open = new JButton("Open");
              area = new JTextArea();
              panel = new JPanel();
              setup();
              Secrecy.center(this);
         public void setup() {
              setupButtons();
              setupText();
              pack();
         void setupButtons() {
              encrypt.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                        PassFrame pf = new PassFrame();
                        pf.show();
                        Secrecy.frameWait(pf);     
                        System.out.println("Trying to run Encryption sequence");                    
                        prog.runEncryption(area, pf.getPassword());
              open.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                        prog.runChooser();
              getContentPane().add(encrypt, BorderLayout.EAST);
              getContentPane().add(open, BorderLayout.SOUTH);
         void setupText() {
              area = new JTextArea(10, 55);
              area.setLineWrap(true);
              area.setWrapStyleWord(true);
              pane = new JScrollPane(area);
              getContentPane().add(pane, BorderLayout.CENTER);
    class Dice {
         // random num generator
         static Random r;
         int sides;
         private static long seedLockVal;
         public Dice( int si ) {
              sides = si;
         public int roll() {
              return d( sides ) + 1;
         static {
              setSeedLock();
         public static int d( int what ) {
              if ( what <= 1 ) return 0;
              int val = r.nextInt() / 64;
              int v = (int)( val % what );
              if ( v < 0 ) v *= -1;
              return v;
         public static long setSeedLock() {     
              seedLockVal = System.currentTimeMillis();
              r = new Random( seedLockVal );
              return seedLockVal;
         public static void setSeed( long val ) {
              seedLockVal = val;
              r = new Random( val );
    class WindowCloser extends JFrame {
         JButton ok;
         JButton cancel;
         JLabel check;
         JLabel warning;
         JPanel panel;
         WindowCloser() {
              setResizable(false);
              check = new JLabel("Are you sure you wish to exit? You will lose all data.");
              warning = new JLabel("Closing this window will exit the program.");
              ok = new JButton("OK");
              cancel = new JButton("Cancel");
              ok.addActionListener( new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                        System.exit(0);
              cancel.addActionListener( new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                        hide();
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent evt) {
                        System.exit(0);
              panel = new JPanel();
              panel.add(check);
              panel.add(warning);
              panel.add(ok);
              panel.add(cancel);
              getContentPane().add(panel);
              pack();
              Secrecy.center(this);
              show();
         public static void main(String[] args) {
              WindowCloser wc = new WindowCloser();

    Oh shit...
    Please post concise pieces of code where problems occur.
    Just a few remarks:
         static void fileChooserWait(JFileChooser chooser) {
              while(chooser.isVisible()) {
                   nap(100);
         }If you use JFileChooser#showXXXDialog, the method will block until the dialog has been disposed of (closed).
         WindowCloser() {
              setResizable(false);
    check = new JLabel("Are you sure you wish to exit?
    t? You will lose all data.");
    warning = new JLabel("Closing this window will exit
    it the program.");
              ok = new JButton("OK");
              cancel = new JButton("Cancel");Have a look at the static methods of the javax.swing.JOptionPane class. They're pretty useful.
    These remarks may not help you much, but I for one am not going to read all of this.
    Oh, and please acknowledge the [url http://forum.java.sun.com/help.jspa?sec=formatting]Formatting tips and post your code between [code[b]][[b]code] blocks.

  • Design issue using JFrame, JPanel, JLabel

    I have been working on this problems for several months now and I and nearly finished.
    I have a design question I hope others from this forum can provide some incite to the best approach.
    The problem space is a 8 X 8 Chessboard. I have designed a board using JPanels and JLables sitting inside a JFrame. In each square on the chessboard is a JLabel with an image. The "board" sits in the DEFAULT LAYER of a JLayeredPane. As the user clicks a specific square, a queen is placed in the square (8-queens problem). The only thing I do is swap out the image. All this works well--thanks to several of you from this forum. :-)
    When I add a new queen to the board, the application goes through the evaluation of attack positions. Next, the application should display the new chessboard with only the queens not threaten by other queens. I keep up with the chessboard using an boolean array internally. I build a second boolean array for the new or refreshed chessboard.
    What I want to do is build a second chessboard and "swap" it out with the one in the default layered pane. Can someone be so kind and shine some light on this design issue for me?
    Thank you for taking the time to read my post.

    I don't understand this approach. Swing is by default 'double buffered' and will not flicker. You will get this be default since this is one of the things the Swing painting model gives over AWT.
    You should look at just using JComponent and the paintComponent() method for drawing what you need.
    What I've done in the past is have a simple XML JDoM model. Have components that render themselves based on this model.
    Changing the model then I just issues a call to repaint() at the top level container.
    You can also add and remove items from the parent container. Then issue validate() or repaint(). Can't remember now but I think validate() hits the layout manager logic and then repaints.
    I'm pretty sure the Romain guy posted an example of how to easily draw a background chess board in a panel. ;-)
    The tree concept might really prove useful for a 'gaming tree' approach at the AI also.
    If you look at the Java3D API you will see they use a tree to represent what is rendered and the details about it. Really nice until you change something in the tree that cause the renderer to blow up. ;-)
    I guess the moral is always make small simple changes and test.
    Hope this is helpful.

Maybe you are looking for

  • How to get the location of a jarfile in the java 1.6 cache

    In 1.5 i am using getResource() to get the location of the jarfile i need, but in 1.6 this does not work anymore. I found a webpage with a workaround for this, but unfortunately i did not bookmark it and i can't find it again. Does anybody know how t

  • A/r Credit Memo Not Displayed on Incoming Payment  Table

    We created a new Credit Memo but we are able to see it in the Incoming Payment Table..Is there any flag that can help us to identify if the A/r Credit is unpaid... I took a look at A/R Credit memo Header and Line(i.e ORIN and RIN1) to compare with ot

  • Simple question, how to get photos fading in and out

    Sorry, don't use Flash much at all, I'm trying to do something that's probably very simple.  This question has probably been answered before but I'm not even really sure what keywords to search for, I tried slideshow and a glut of irrelevant info cam

  • KE80 report two times value effected

    Hi Experts, I have one issues regarding MIS report Thru KE80 , in this report we have pass the one Entry of Rs. 10,500/- Accounting Entry is 40 Depreciation M            A/c 400100               Debit 10,000    Cost Center F200 i.e Finance  (Cost Ele

  • Connection Timed Out error when I try to access Alert Inbox

    Hi experts, I have not been looking at my alert inbox for a while and I suspect it's very full. When I tried to open the alert inbox from RWB, I encountered the following error: <b>500 Connection timed out Error: -5 Version: 7000 Component: ICM Date/