harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey A. Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-1801) [classlib][swing] JComponent.setBounds() should not cause revalidation
Date Fri, 17 Nov 2006 13:07:41 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1801?page=all ]

Alexey A. Ivanov updated HARMONY-1801:
--------------------------------------

    Attachment: HTest1801.java

HTest1801.java is slightly reworked application which was present in description of the bug.
If you run it, you'll see a button which covers all the frame. After a little while a new
size is set to this button, and the button must be position of the left top corner with size
150, 50. Without the fix applied, setting its size doesn't change anything -- the button stays
unchanged.

> [classlib][swing] JComponent.setBounds() should not cause revalidation
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-1801
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1801
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitry A. Durnev
>         Assigned To: Mikhail Loenko
>            Priority: Minor
>         Attachments: H1801-BasicTabbedPaneUI.patch, H1801-fix.patch, H1801-tests.patch,
H1801-tests.patch, HTest1801.java
>
>
> Validation process should not be initiated by component reshaping to avoid too
> many re-validations while doing layout (layout usually causes reshape).
> Therefore JComponent.setBounds() should not call revalidate. 
> Compile & run the following test:
> import java.awt.EventQueue;
> import java.lang.reflect.InvocationTargetException;
> import javax.swing.JButton;
> import javax.swing.JFrame;
> public class SetBoundsTest {
>     
>     public static void main(String[] args) throws InterruptedException, InvocationTargetException
{
>         final JFrame jf = new JFrame("test");
>         final JButton jb = new JButton("1");        
>         jf.getContentPane().add(jb);
>         jf.setSize(200, 200);
>         EventQueue.invokeAndWait(new Runnable(){
>             public void run() {
>                 jf.show();                
>             }
>             
>         });
>         EventQueue.invokeAndWait(new Runnable(){
>             public void run() {
>                 jb.setSize(150, 500);                
>             }
>             
>         });
>         
>         EventQueue.invokeAndWait(new Runnable(){
>             public void run() {
>                 System.out.println(jb.getSize());
>                 jf.dispose();           
>             }
>             
>         });
>         
>     }
> }
> On RI button size set by user(150, 500) is printed. On Harmony some other size (set by
layout) is printed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message