Results 1 to 2 of 2
  1. #1
    ottawalyli is offline Member
    Join Date
    Dec 2007
    Posts
    3
    Rep Power
    0

    Default Why the panel text changed?

    Hello, I ran into a strange problem:

    I have two panels in sequence, both of them displayed from the same JFrame. The JFrame has an Image in the "West" (BorderLayoutManeger). The image is shared between the two panels. The problematic part is the JPanel in the center, which is different from panel to panel.

    The first time, a new JPanel is added and a non-editable JEditorPane is added to the JPanel. It displays Text "AAA". I can minimize or hide the panel and then bring the panel back. No problem.


    Later a new JPanel is created and a JLabel is added the the new JPanel, and the the new JPanel is set to the center of the JFrame. It first displays text "BBB" properly. But when I minimize or hide the panel, and then bring the panel back, the panel goes back to text "AAA". And it always displays "AAA".

    Any suggestions?

    Thanks in advance.

  2. #2
    ottawalyli is offline Member
    Join Date
    Dec 2007
    Posts
    3
    Rep Power
    0

    Default

    Looks like I can not simply set the JPanel to the center pane of the JFrame. Instead, before I set the new center content, I have to explicitly remove the JPanel from the center panel.

Similar Threads

  1. Java Control Panel not saving changes when I press OK
    By RebelScum in forum New To Java
    Replies: 0
    Last Post: 03-21-2008, 04:22 PM
  2. Why the panel text changed?
    By ottawalyli in forum SWT / JFace
    Replies: 0
    Last Post: 12-16-2007, 04:16 PM
  3. How to place panel into frame
    By vivek_9912 in forum AWT / Swing
    Replies: 2
    Last Post: 11-19-2007, 11:21 PM
  4. Help with drag from panel
    By fernando in forum AWT / Swing
    Replies: 2
    Last Post: 08-07-2007, 10:19 PM
  5. Strings are immutable yet they can be changed ?
    By anjanesh in forum New To Java
    Replies: 4
    Last Post: 05-19-2007, 03:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •