-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.4.2
-
x86
-
windows_2000
FULL PRODUCT VERSION :
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 2000 5.00.2195 SP4
A DESCRIPTION OF THE PROBLEM :
Under 1.4.2 and also 1.5.0, <Ctrl-F6> fails in navigating between between internal frames with keyboard.
When putting a JComponent as "back image", cache is incorrectly computed : it is computed every time AND JComponent is taken in the cache when further usage suppose that it can only be JInternalFrame or BasicDesktopPaneUI.
Note that removing the back panel makes the navigation OK.
Trying to put a "not JComponent" (like a Container) does not solve, it generates a NPE at cache usage.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the provided class, hit more than 3 times the "New" menu item.
Then use <CTRL-F6> to navigate through the internal frames.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Focus must go through all the opened internal frames
ACTUAL -
Only the two last focused internal frames are navigated
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Color;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
public class EcranApplication extends javax.swing.JFrame
{
int nbFrames = 0;
public EcranApplication()
{
super();
setVisible(false);
setResizable(true);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setSize(800, 570);
final javax.swing.JDesktopPane desk = new javax.swing.JDesktopPane();
setContentPane( desk ) ;
javax.swing.JTextArea postIt = new javax.swing.JTextArea( 12, 41 );
postIt.setBackground(new Color(255, 255, 123) );
postIt.setDisabledTextColor(Color.black);
postIt.setWrapStyleWord(true) ;
postIt.setLineWrap(true) ;
postIt.setEnabled(false);
postIt.setEditable(false);
postIt.setBorder(
new TitledBorder( new LineBorder(Color.black, 1), "Message",
TitledBorder.CENTER, TitledBorder.BELOW_TOP
)
);
postIt.setSize(postIt.getPreferredSize());
postIt.setLocation( 0, 0 );
postIt.setText("...This is a long long long text shown as message of the day,\ncan be updated at connexion time for instance...");
int largPostIt = postIt.getWidth();
int hautPostIt = postIt.getHeight();
int xLab = (800 - largPostIt) / 2;
int yLab = ( 570 - hautPostIt) / 2;
javax.swing.JLabel lab = new javax.swing.JLabel();
lab.setBounds( xLab, yLab, largPostIt, hautPostIt );
lab.add( postIt, 0 );
// putting the followibg line in comment makes CTRL-F6 OK
desk.add( lab, javax.swing.JLayeredPane.DEFAULT_LAYER) ;
setJMenuBar( new javax.swing.JMenuBar() );
javax.swing.JMenuItem fileMenuItem= new javax.swing.JMenuItem(
new javax.swing.AbstractAction("New")
{
public void actionPerformed(java.awt.event.ActionEvent e)
{
javax.swing.JInternalFrame fen = new javax.swing.JInternalFrame();
fen.setClosable(true);
fen.setDefaultCloseOperation(javax.swing.JFrame.DISPOSE_ON_CLOSE);
fen.setIconifiable(true);
fen.setMaximizable(true);
fen.setResizable(true);
fen.setSize(360,180);
fen.setTitle("Internal Frame #"+nbFrames++);
fen.setLocation(20*nbFrames, 20*nbFrames);
desk.add(fen);
fen.setVisible(true);
if (fen.isClosed())
{
try
{ fen.setClosed(false); }
catch (java.beans.PropertyVetoException e1)
{ e1.printStackTrace(); }
}
if (fen.isIcon())
{
try
{ fen.setIcon(false); }
catch (java.beans.PropertyVetoException e1) { e1.printStackTrace(); }
}
show();
try { fen.setSelected(true); }
catch (Exception e2) {e2.printStackTrace();};
}
} );
getJMenuBar().add(fileMenuItem);
addWindowListener( new java.awt.event.WindowAdapter()
{
public void windowClosing(java.awt.event.WindowEvent e)
{
setVisible(false);
System.exit(0);
}
});
}
public static void main (java.lang.String args[])
{
try
{
EcranApplication ecran = new EcranApplication();
ecran.show();
}
catch (java.lang.Throwable e) { e.printStackTrace(); }
}
}
---------- END SOURCE ----------
###@###.### 2004-12-16 22:04:29 GMT
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 2000 5.00.2195 SP4
A DESCRIPTION OF THE PROBLEM :
Under 1.4.2 and also 1.5.0, <Ctrl-F6> fails in navigating between between internal frames with keyboard.
When putting a JComponent as "back image", cache is incorrectly computed : it is computed every time AND JComponent is taken in the cache when further usage suppose that it can only be JInternalFrame or BasicDesktopPaneUI.
Note that removing the back panel makes the navigation OK.
Trying to put a "not JComponent" (like a Container) does not solve, it generates a NPE at cache usage.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the provided class, hit more than 3 times the "New" menu item.
Then use <CTRL-F6> to navigate through the internal frames.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Focus must go through all the opened internal frames
ACTUAL -
Only the two last focused internal frames are navigated
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Color;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
public class EcranApplication extends javax.swing.JFrame
{
int nbFrames = 0;
public EcranApplication()
{
super();
setVisible(false);
setResizable(true);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
setSize(800, 570);
final javax.swing.JDesktopPane desk = new javax.swing.JDesktopPane();
setContentPane( desk ) ;
javax.swing.JTextArea postIt = new javax.swing.JTextArea( 12, 41 );
postIt.setBackground(new Color(255, 255, 123) );
postIt.setDisabledTextColor(Color.black);
postIt.setWrapStyleWord(true) ;
postIt.setLineWrap(true) ;
postIt.setEnabled(false);
postIt.setEditable(false);
postIt.setBorder(
new TitledBorder( new LineBorder(Color.black, 1), "Message",
TitledBorder.CENTER, TitledBorder.BELOW_TOP
)
);
postIt.setSize(postIt.getPreferredSize());
postIt.setLocation( 0, 0 );
postIt.setText("...This is a long long long text shown as message of the day,\ncan be updated at connexion time for instance...");
int largPostIt = postIt.getWidth();
int hautPostIt = postIt.getHeight();
int xLab = (800 - largPostIt) / 2;
int yLab = ( 570 - hautPostIt) / 2;
javax.swing.JLabel lab = new javax.swing.JLabel();
lab.setBounds( xLab, yLab, largPostIt, hautPostIt );
lab.add( postIt, 0 );
// putting the followibg line in comment makes CTRL-F6 OK
desk.add( lab, javax.swing.JLayeredPane.DEFAULT_LAYER) ;
setJMenuBar( new javax.swing.JMenuBar() );
javax.swing.JMenuItem fileMenuItem= new javax.swing.JMenuItem(
new javax.swing.AbstractAction("New")
{
public void actionPerformed(java.awt.event.ActionEvent e)
{
javax.swing.JInternalFrame fen = new javax.swing.JInternalFrame();
fen.setClosable(true);
fen.setDefaultCloseOperation(javax.swing.JFrame.DISPOSE_ON_CLOSE);
fen.setIconifiable(true);
fen.setMaximizable(true);
fen.setResizable(true);
fen.setSize(360,180);
fen.setTitle("Internal Frame #"+nbFrames++);
fen.setLocation(20*nbFrames, 20*nbFrames);
desk.add(fen);
fen.setVisible(true);
if (fen.isClosed())
{
try
{ fen.setClosed(false); }
catch (java.beans.PropertyVetoException e1)
{ e1.printStackTrace(); }
}
if (fen.isIcon())
{
try
{ fen.setIcon(false); }
catch (java.beans.PropertyVetoException e1) { e1.printStackTrace(); }
}
show();
try { fen.setSelected(true); }
catch (Exception e2) {e2.printStackTrace();};
}
} );
getJMenuBar().add(fileMenuItem);
addWindowListener( new java.awt.event.WindowAdapter()
{
public void windowClosing(java.awt.event.WindowEvent e)
{
setVisible(false);
System.exit(0);
}
});
}
public static void main (java.lang.String args[])
{
try
{
EcranApplication ecran = new EcranApplication();
ecran.show();
}
catch (java.lang.Throwable e) { e.printStackTrace(); }
}
}
---------- END SOURCE ----------
###@###.### 2004-12-16 22:04:29 GMT
- relates to
-
JDK-8039945 JDesktopPane's remove(Component) should check componentOrderCheckingEnabled
-
- Closed
-