tailieunhanh - Java Swing phần 3

Chỉ xem khung sẽ ném ra một lỗi nếu một nỗ lực được thực hiện thêm các thành phần trực tiếp vào khung hình (chứ không phải là khung nội dung của nó) hoặc thiết lập quản lý bố trí. Theo mặc định, đây là thiết lập một khi khung đã được xây dựng. Lớp con có thể thay đổi tài sản này nếu cần thiết, nhưng điều này không được khuyến cáo. | Java Swing - O Reilly The following fields are available to subclasses of JFrame protected AccessibleContext accessibleContext Contains the AccessibleJFrame for this frame. protected JRootPane rootPane Contains the frame s root pane. protected boolean rootPaneCheckingEnabled Indicates whether the frame will throw an Error if an attempt is made to add components directly to the frame rather than to its content pane or to set the layout manager. By default this is set to true once the frame has been built. Subclasses could change this property if necessary but this is not recommended. Constructors public JFrame Creates a new unnamed invisible frame. public JFrame String title Creates an invisible frame with the specified title. User Interface Methods public void update Graphics g Overrides to do nothing but call paint . This is consistent with the implementation of update provided by JComponent. Protected Methods protected void addImpl Component comp Object constraints int index This method called by add is overridden to throw an Error when an attempt is made to add a component directly to the JFrame. The only component allowed to be added is the JRootPane which fills the entire frame using . protected JRootPane createRootPane Called by the constructor to create the frame s JRootPane. protected void frameInit Called by the constructor to enable key and window events set the root pane and set the background color. The last thing this method does is set the rootPaneCheckingEnabled field to true. protected boolean isRootPaneCheckingEnabled - 199 - Java Swing - O Reilly Indicates whether the frame will throw an Error if an attempt is made to add a component directly to the frame. protected void processKeyEvent KeyEvent e Forwards the event to JComponent s processKeyBindingsForAllComponents static method. protected void processWindowEvent WindowEvent e Allows the superclass implementation to process the event. .

TỪ KHÓA LIÊN QUAN