Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
Name: skT88420 Date: 01/05/2000 java version "1.3beta" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O) Java(TM) HotSpot Client VM (build 1.3beta-O, mixed mode) I have a JDesktopPane and many internal frame when the focus is in one of them, if I select another component outside of the JDesktopPane and then I select the foreground Internal Frame with the border, the focus is not set to the content of the frame. example : import java.lang.*; import javax.swing.*; import java.awt.*; public class FrameBug extends JInternalFrame { static void main(String[] args) { JDialog dialog = new JDialog((Frame) null, true); dialog.setSize(new Dimension(1000,600)); BorderLayout borderLayout_ = new BorderLayout(); dialog.getContentPane().setLayout( borderLayout_ ); final JDesktopPane desktopPane = new JDesktopPane(); dialog.getContentPane().add(desktopPane,BorderLayout.CENTER); dialog.getContentPane().add(new JTextField(),BorderLayout.SOUTH); for (int i = 0 ; i < 2 ; i++) { JInternalFrame frame = new JInternalFrame("test",true,true,true,true); frame.getContentPane().add(new JTextArea("test " + i)); frame.pack(); frame.setBounds(new Rectangle(i*30,i*30,400, 400)); frame.setVisible(true); desktopPane.add(frame); } dialog.setVisible(true); System.exit(0); } } with this example, anytime you select a frame with the border the focus is set on the content of it (the text area). But if you select the TextField on the south and then the foreground frame with the border the textarea don't have focus. (Review ID: 99617) ======================================================================
|