summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2004-06-26 16:06:46 +0000
committerMark Wielaard <mark@klomp.org>2004-06-26 16:06:46 +0000
commitc1c4c615212b8ac95d383af9a8c95d0f09808a55 (patch)
tree391ba4ee4bf7fa3b1f0ab432948a33f34bcf4229 /java
parent755c1990e0d5a86bb89deb4f76c6fd2bc55852be (diff)
downloadclasspath-c1c4c615212b8ac95d383af9a8c95d0f09808a55.tar.gz
2004-06-26 Mark Wielaard <mark@klomp.org>
* include/gnu_java_awt_peer_gtk_GdkFontMetrics.h: Regenerated. * javax/swing/plaf/basic/BasicMenuUI.java (mousePressed): Don't call protected JMenu methods fireMenuCanceled() and fireMenuSelected(). * javax/swing/Makefile.am (EXTRA_DIST): Add jTextArea. * javax/swing/plaf/basic/Makefile.am (EXTRA_DIST): Add BasicDesktopIconUI.java, BasicDesktopPaneUI.java, BasicInternalFrameTitlePane.java, BasicInternalFrameUI.java, BasicPopupMenuSeparatorUI.java and BasicToolBarUI.java. 2004-06-26 Graydon Hoare <graydon@redhat.com> * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c: Fix up non-ansi comments. 2004-06-26 Ranjit Mathew <rmathew@hotmail.com> * javax/swing/text/AbstractDocument.java: Adding missing import for javax.swing.event.EventListenerList. * javax/swing/text/DefaultCaret.java: Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JToolBar.java (name): Removed. (JToolBar): Use Component.setName(String) instead of doing it all alone. * javax/swing/Timer.java (queueEvent): Added missing modifier. 2004-06-26 Olga Rodimina <rodimina@redhat.coom> * javax/swing/JMenu.java: (insertSeparator): Implemented. * javax/swing/JPopupMenu.java: (JPopupMenu.Separator): Implemented. * javax/swing/MenuSelectionManager.java: (processMouseEvent): Use java.awt.Component for event source instead of javax.swing.JComponent. * javax/swing/plaf/basic/BasicPopupMenuSeparatorUI.java: New File. Implemented. 2004-06-26 David Jee <djee@redhat.com> * java/awt/GridBagLayout.java (GetLayoutInfo): Adjust cell sizes iff parent size is not zero. Make sure pos_x and pos_y are never negative. 2004-06-26 Andrew Overholt <overholt@redhat.com> * javax/swing/JToolBar.java Partially implemented. * javax/swing/plaf/basic/BasicToolBarUI.java New file. Partially implemented. 2004-06-26 Graydon Hoare <graydon@redhat.com> * gnu/java/awt/peer/gtk/GdkGraphics2D.java (setComposite): Accept AlphaComposite arguments. * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java (createBufferedImage): Add new overloads. * gnu/java/awt/peer/gtk/GtkToolkit.java (createImage): Use GdkPixbufDecoder.createBufferedImage when useGraphics2D() is true. (getImage): Delegate to createImage. * javax/swing/JList.java (isSelectionEmpty): (getFirstVisibleIndex): (getLastVisibleIndex): (setSelectedValue): (ensureIndexIsVisible): New methods. * javax/swing/Timer.java: Reimplement. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/text/AbstractDocument.java (AbstracElement): Made public, implements java.io.Serializable. (AttributeContext): Made public. (BranchElement): Likewise. (Content): Likewise. (DefaultDocumentEvent): Made public, extends javax.swing.undo.CompoundEdit. (ElementEdit): Made public, extends javax.swing.undo.AbstractUndoableEdit. (LeafElement): Made public. (LeafElement.LeafElement): Made public. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/text/JTextComponent.java: Totally reworked. Removed many methods (that were obviously never be intended to get included hi this class. Added some methods too. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/text/PlainDocument.java (serialVersionUID): New constant. (lineLimitAttribute): Likewise. (tabSizeAttribute): Likewise. (tabSize): New field. (PlainDocument): Made public. (PlainDocument): New constructor. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/text/AbstractDocument.java (insertString): Throws BadLocationException. * javax/swing/text/Document.java (insertString): Likewise. * javax/swing/text/JTextComponent.java: Javadocs and comments cleaned up. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/event/UndoableEditListener.java: Reformatted. * javax/swing/text/AbstractDocument.java (AbstractDocument): Implements java.io.Serializable. (doc_list): Removed. (undo_list): Removed. (AbstractElement.serialVerionUID): New field. (BranchElement.serialVerionUID): Likewise. (DefaultDocumentEvent.serialVerionUID): Likewise. (ElementEdit.serialVerionUID): Likewise. (LeafElement.serialVerionUID): Likewise. (serialVerionUID): Likewise. (BAD_LOCATION): New constant. (BidiElementName): Likewise. (ContentElementName): Likewise. (ParagraphElementName): Likewise. (SectionElementName): Likewise. (ElementNameAttribute): Likewise. (AbstractDocument): Made protected. (AbstractDocument): New construtor. (listenerList): New field. (fireChangedUpdate): Implemented. (fireInsertUpdate): Likewise. (fireRemoveUpdate): Likewise. (fireUndoableEditUpdate): Likewise. (getListeners): Likewise. (addDocumentListener): Likewise. (removeDocumentListener): Likewise. (addUndoableEditListener): Likewise. (removeUndoableEditListener): Likewise. (getDocumentListeners): New method. (getUndoableEditListeners): Likewise. (getAsynchronousLoadPriority): Made public. (getBidiRootElement): Likewise. (setAsynchronousLoadPriority): Likewise. (setDocumentProperties): Likewise. * javax/swing/text/BadLocationException.java (serialVerionUID): New field. * javax/swing/text/DefaultCaret.java (changeEvent): New field. (listenerList): Likewise. (changes): Removed. (addChangeListener): Reimplemented. (removeChangeListener): Likewise. (getListeners): New method. (getChangeListeners): Likwise. (getComponent): Likewise. * javax/swing/text/GapContent.java (GapContent): Implements java.io.Serializable. (serialVerionUID): New field. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JTree.java (treeModel): New field. (JTree): New constructors, one existing one made public. (createTreeModel): New method. (addTreeExpansionListener): Likewise. (removeTreeExpansionListener): Likewise. (getTreeExpansionListeners): Likewise. (fireTreeCollapsed): Likewise. (fireTreeExpanded): Likewise. (addTreeSelectionListener): Likewise. (removeTreeSelectionListener): Likewise. (getTreeSelectionListeners): Likewise. (fireValueChanged): Likewise. (addTreeWillExpandListener): Likewise. (removeTreeWillExpandListener): Likewise. (getTreeWillExpandListeners): Likewise. (fireTreeWillCollapse): Likewise. (fireTreeWillExpand): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JTree.java: Reformatted. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JTextArea.java: New file. * javax/swing/JTextField.java (actions): Removed. (notifyAction): New constant. (columns): New field. (JTextField): New constructors. (createDefaultModel): New method. (addActionListener): Reimplmemented. (removeActionListener): Reimplemented. (getActionListeners): New method. (fireActionPerformed): New method. (getColumns): New method. (setColumne): New method. * javax/swing/text/JTextComponent.java (AccessibleJTextComponent.serialVersionUID): New field. (serialVersionUID): Likewise. (DEFAULT_KEYMAP): Likewise. (FOCUS_ACCELERATOR_KEY): Likewise. (doc): Made private. (icon_gap): Likewise. (icon): Likewise. (align): Likewise. (JTextComponent): Some constructors removed. (getScrollableTracksViewportHeight): New method. (getScrollableTracksViewportWidth): Likewise. 2004-06-26 Graydon Hoare <graydon@redhat.com> * javax/swing/ImageIcon.java (ImageIcon): New constructor. * javax/swing/JFrame.java (defaultLookAndFeelDecorated): New property. * javax/swing/JViewport.java (getExtentSize): Return size rather than preferred size. (toViewCoordinates): New methods. (getViewSize): Return size rather than preferred size. (setViewSize): Note view size as set. * javax/swing/ViewportLayout.java (layoutContainer): Reimplement. * javax/swing/plaf/basic/BasicScrollBarUI.java (getPreferredSize): Don't redo layout. * javax/swing/plaf/basic/BasicViewportUI.java (paint): Translate image properly and eat exceptions. 2004-06-26 Kim Ho <kho@redhat.com> * javax/swing/JTabbedPane.java (setComponent): Remove old component and add new component. (setSelectedIndex): Don't operate on the components if they're null. Don't set index on the model if the index is the same. (insertTab): Don't add or hide the component if it's null. Repaint the container. * javax/swing/plaf/basic/BasicLookAndFeel.java Change colors for TabbedPane. * javax/swing/plaf/basic/BasicTabbedPaneUI.java (mousePressed): Re-layout and paint the component. (layoutContainer): Don't set location on the view. (ScrollingViewport::paint): Remove. 2004-06-26 Thomas Fitzsimmons <fitzsim@redhat.com> * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (gtkWidgetDispatchKeyEvent): Change warning message to comment. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (drawString): Wrap baseline y value in PANGO_PIXELS macro, rather than simply dividing by PANGO_SCALE. Call gdk_flush before leaving GDK critical region. (drawLine): Call gdk_flush before leaving GDK critical region. (fillRect): Likewise. (drawRect): Likewise. (copyArea): Likewise. (copyPixmap): Likewise. (clearRect): Likewise. (drawArc): Likewise. (drawPolyline): Likewise. (drawPolygon): Likewise. (fillPolygon): Likewise. (fillArc): Likewise. (drawOval): Likewise. (fillOval): Likewise. * gnu/java/awt/peer/gtk/GdkFontMetrics.java (initState): Add style parameter. (GdkFontMetrics): Add style argument to initState call. (stringWidth(String,int,int,String)): Add style parameter. (stringWidth(String)): Add style argument to stringWidth call. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c (initState): Set pango font style and weight based on AWT style parameter. Pass default GTK language to pango_context_get_metrics. Use PANGO_PIXELS macro rather than simply dividing by PANGO_SCALE. (stringWidth): Set pango font style and weight based on AWT style parameter. * java/awt/Button.java (next_button_number): New field. (paramString): Change output. (generateName): New method. (getUniqueLong): New method. 2004-06-26 Kim Ho <kho@redhat.com> * javax/swing/JTabbedPane.java: (setComponentAt): Set the component, not the enabled status. * javax/swing/plaf/basic/BasicDesktopIconUI.java (actionPerformed): Let deiconize catch exception. 2004-06-26 Olga Rodimina <rodimina@redhat.com> * javax/swing/JPopupMenu.java: (setVisible): Corrected location of a heavyweight popup menu. 2004-06-26 Olga Rodimina <rodimina@redhat.com> * javax/swing/MenuSelectionManager.java: Ran through jalopy to fix formatting style. 2004-06-26 Olga Rodimina <rodimina@redhat.com> * javax/swing/JLayeredPane.java: (remove): Revalidate and repaint layered pane after the component was removed. javax/swing/JMenu.java: (setVisible): Display popup menu at the user location, if one was set by the user. (setMenuLocation): Reimplemented. Fixed javadoc. * javax/swing/JMenuBar.java: Added javadoc. (BORDER_PAINTED_CHANGED_PROPERTY): New Property. (MODEL_CHANGED_PROPERTY): New Property. (isSelected): Implemented. (setBorderPainted): Fire PropertyChangeEvent if paintBorder property changes. (setSelected): Implemented. (setSelectionModel): Implemented. * javax/swing/JPopupMenu.java: Added Javadoc (pack): Implemented. (setVisible): Reimplemented. (show): Fixed location. (JPopupMenu.LigthWeightPopup): Reimplemented to use Container instead of JPanel. * javax/swing/MenuSelectionManager.java: Added Javadocs. (clearSelectedPath): Reimplemented to clear selectedPath in reverse order. (processMouseEvent): Reimplemented. (setSelectedPath): Fire stateChange event indicating that selected menu path has changed. (getPath): Change to use ArrayList instead of Vector. * javax/swing/plaf/basic/BasicMenuBarUI.java: (installUI): call installKeyboardActions(). (uninstallUI): call uninstallKeyboardActions(). 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/text/DefaultCaret.java, javax/swing/text/BadLocationException.java: Reformatted. 2004-06-26 Thomas Fitzsimmons <fitzsim@redhat.com> * gnu/java/awt/peer/gtk/GtkTextAreaPeer.java (DEFAULT_ROWS, DEFAULT_COLS): New variables. (create): Don't allow 0 rows or 0 columns. Instead, set the values to DEFAULT_ROWS or DEFAULT_COLS. (getMinimumSize): Likewise. (getPreferredSize): Likewise. (minimumSize): Likewise. (preferredSize): Likewise. (create): Set peer's editable state. * java/awt/TextArea.java (TextArea()): Set rows and columns to zero. Update javadocs. (TextArea(String)): Likewise. (TextArea(int,int)): Fix javadocs. (TextArea(String,int,int,int)): Only throw exception if one of rows or columns is zero. Fix javadocs. 2004-06-26 Thomas Fitzsimmons <fitzsim@redhat.com> * java/awt/AWTEvent.java (toString): Handle MenuComponents in addition to Components. * java/awt/MenuItem.java (dispatchEventImpl): If the event wasn't consumed by normal processing, send it to the parent menu. * gnu/java/awt/peer/gtk/GtkImagePainter.java (setPixels(int,int,int,int,ColorModel,int[],int,int)): Remove translation. 2004-06-26 David Jee <djee@redhat.com> * java/awt/MediaTracker.java (addImage(Image,int)): Call imageUpdate() to udpate image status. (addImage(Image,int,int,int)): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/text/AbstractDocument.java, javax/swing/text/Document.java, javax/swing/text/GapContent.java, javax/swing/text/JTextComponent.java, javax/swing/text/PlainDocument.java: Reformatted. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JRootPane.java (AccessibleJRootPane.serialVersionUID): New field. (AccessibleJRootPane.AccessibleJRootPane): New constructor. (AccessibleJRootPane.getAccessibleRole): New method. (RootLayout): Implements Serializable. (RootLayout.serialVersionUID): New field. (RootLayout.RootLayout): New constructor. (setJMenuBar): Made public. (getJMenuBar): Likewise. (JRootPane): Likewise. (createContentPane): Likewise. (createGlassPane): Likewise. (createLayeredPane): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/SwingUtilities.java (isLeftMouseButton): Fixed javadoc. (isMiddleMouseButton): Likewise. (isRightMouseButton): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JScrollPane.java (serialVersionUID): New field. (columnHeader): Made protected. (rowHeader): Likewise. (lowerLeft): Likewise. (lowerRight): Likewise. (upperLeft): Likewise. (upperRight): Likewise. (horizontalScrollBar): Likewise. (horizontalScrollBarPolicy): Likewise. (verticalScrollBar): Likewise. (verticalScrollBarPolicy): Likewise. (viewport): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/LookAndFeel.java: Fixed javadocs. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JEditorPane.java: Fixed javadocs. (JEditorPane): Removed redundant call to to this(). (fireHyperlinkUpdate): Implemented. 2004-06-26 Olga Rodimina <rodimina@redhat.com> * javax/swing/JMenu.java: Fixed file name in the file comment. 2004-06-26 Olga Rodimina <rodimina@redhat.com> * javax/swing/JMenu.java: Added javadoc. (JMenu): Added MenuChangeListener to listen to ChangeEvents occuring in menu's model. (insert): Throw IllegalArgumentException if index is less than 0 (setSelected): Reimplement. (setPopupMenuVisible): Call menu's model isEnabled() (setDelay): Throw IllegalArgumentException if given amount of delay is less than 0. (createActionComponent): Implemented. (createActionChangeListener): Implemented. (addSeparator): Implemented. (getItem): Throw IllegalArgumentException if index is less than 0. (getItemCount): Implemented. (fireMenuSelected): Changed to use menuEvent. (fireMenuDeselected): Likewise. (fireMenuCanceled): Likewise. (setAccelerator): Changed to throw an error if this method is used. (doClick): Implemented. (JMenu.ActionChangedListener): New inner class to handle PropertyChangeEvents occuring in the actions associated with menu. * javax/swing/plaf/basic/BasicMenuUI.java: Added javadoc. (BasicMenuUI): Added PropertyChangeListener to the menu. (createChangeListener): Implemented. (createMenuDragMouseListener): Likewise. (createMenuKeyListener): Likewise. (createPropertyChangeListener): Likewise. (uninstallListeners): Likewise. (BasicMenuUI.MouseInputHandler): Reimplemented. (BasicMenuUI.PropertyChangeHandler): New class. Not implemented yet. (BasicMenuUI.ChangeHandler): Likewise. (BasicMenuUI.MenuDragMouseHandler): Likewise. (BasicMenuUI.MenuKeyHandler): Likewise. 2004-06-26 David Jee <djee@redhat.com> * java/awt/MediaTracker.java (imageUpdate): Only do notifyAll() if the image is complete. 2004-06-26 Olga Rodimina <rodimina@redhat.com> * javax/swing/JApplet.java: (getJMenuBar): Made public. (setJMenuBar): Likewise. * javax/swing/JFrame.java: (getJMenuBar): Made public. (setJMenuBar): Likewise. * javax/swing/JWindow.java: (getJMenuBar): Removed. (setJMenuBar): Removed. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JEditorPane.java (createEditorKitForContentType): Fixed visibility. (fireHyperlinkUpdate): Likewise. (getContentType): Likewise. (getEditorKit): Likewise. (getEditorKitForContentType): Likewise. (getPage): Likewise. (read): Likewise. (registerEditorKitForContentTyoe): Likewise. (replaceSelection): Likewise. (setContentType): Likewise. (setEditorKit): Likewise. (setPage): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/Timer.java (Timer): New constructor. * javax/swing/plaf/basic/BasicProgressBarUI.java (animationTimer): Don't initialize at construction. (startAnimationTimer): Added since tag. (stopAnimationTimer): Likewise. (installUI): Use new Timer constructor. * javax/swing/plaf/basic/BasicScrollBarUI.java (installUI): Likewise. * javax/swing/plaf/basic/BasicSliderUI.java (installUI): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/ButtonGroup.java (serialVersionUID): Made private. (buttons): Renamed from v, added javadoc. (sel): Added javadoc. (ButtonGroup): Likewise. (add): Likewise. (remove): Likewise. (getElements): Likewise. (getSelection): Likewise. (setSelected): Likewise. (isSelected): Likewise. (getButtonCount): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/ButtonGroup.java, javax/swing/ImageIcon.java, javax/swing/JEditorPane.java, javax/swing/JRootPane.java, javax/swing/JTextField.java, javax/swing/LookAndFeel.java, javax/swing/plaf/basic/BasicTextUI.java: Reindented. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/text/Style.java: Added javadocs. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JComponent.java (fireVetoableChange): Removed redundant cast. * javax/swing/JLabel.java (getDisabledIcon): Save icon for next call. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/KeyStroke.java (getKeyStroke(char,boolean)): Marked deprecated. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/DefaultCellEditor.java, javax/swing/GrayFilter.java, javax/swing/event/DocumentEvent.java, javax/swing/text/JTextComponent.java, javax/swing/text/MutableAttributeSet.java: Reindented. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/plaf/BorderUIResource.java: Added serialVersionUID all over. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/DefaultButtonModel.java (ARMED): Made public final, fixed value. (ENABLED): Likewise. (PRESSED): Likewise. (ROLLOVER): Likewise. (SELECTED): Likewise. (stateMask): Initialize directly. (listenerList): Likewise. (mnemonic): Likewise. (fireStateChanged): Removed argument, use changeEvent as event. All places where this method is called are fixed too. (getActionCommant): Fixed javadoc. (setGroup): Fixed javadoc. (getGroup): New method. 2004-06-26 Olga Rodimina <rodimina@redhat.com> * javax/swing/AbstractButton.java (AbstractButton): Use init() to initialize the button. (init): New Method. Initializes AbstractButton. * javax/swing/JMenuItem.java: Documented. (JMenuItem): Reimplemented. (init): Implemented. (setEnabled): Changed to call super.setEnabled() (processMouseEvent): Reimplemented. (fireMenuKeyPressed): Implemented. (fireMenuKeyReleased): Implemented. (fireMenuKeyTyped): Implemented. (menuSelectionChanged): disarm the model if the menu item was deselected. * javax/swing/plaf/basic/BasicMenuItemUI.java:Documented. (getPath): Change to use ArrayList instead of Vector. (getPreferredSize): Renamed variable. (paintMenuItem): Paint margin area of menu item. (MouseInputHandler.mouseEntered): Set selection in MenuSelectionManager. (MouseInputHandler.mouseReleased): Check if mouse was pressed inside menu item's bounds before clearing the selection. 2004-06-26 David Jee <djee@redhat.com> * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java (GtkTextComponentPeer): Set caret position to 0. * java/awt/TextComponent.java (setText): Set caret position to 0. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_addExposeFilter): Handle GtkScrolledWindow separately. Fix signal handler blocking. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_removeExposeFilter): Likewise. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Make cursor visible. 2004-06-26 Kim Ho <kho@redhat.com> * java/awt/Container.java (getComponentAt): Removed. * javax/swing/AbstractAction.java (ENABLED_PROPERTY): New property. (putValue): Fire PropertyChangeEvents. (setEnabled): ditto. (firePropertyChange): Javadoc and implement convenience method. * javax/swing/AbstractButton.java (setAction): Don't create PropertyChangeListener if new Action is null. (setIcon): Don't set icon till after comparing it. (configurePropertiesFromAction): Check mnemonic key before calling intValue(). (createActionPropertyChangeListener): Check properties rather than bulk change. * javax/swing/DefaultDesktopManager.java: Implement. * javax/swing/DesktopManager.java: Jalopy and javadoc. * javax/swing/JComponent.java (fireVetoableChange): Implement. (paintImmediately): Use root component. * javax/swing/JDesktopPane.java: Implement * javax/swing/JInternalFrame.java: Implement * javax/swing/JLabel.java (getDisabledIcon): Return grayscaled icon if no disabled icon specified. * javax/swing/JMenuBar.java (getComponentAtIndex): Use getComponent * javax/swing/JOptionPane.java (getDesktopPaneForComponent): Use SwingUtilities' getAncestorOfClass (getFrameForComponent): ditto. * javax/swing/JSplitPane.java (remove): Use getComponent. * javax/swing/SwingUtilities.java (convertPoint): Implement. * javax/swing/plaf/basic/BasicButtonUI.java (paintButtonNormal): Check opaqueness before filling background. * javax/swing/plaf/basic/BasicDesktopIconUI.java: Implement * javax/swing/plaf/basic/BasicDesktopPaneUI.java: Implement. * javax/swing/plaf/basic/BasicInternalFrameTitlePane.java: Implement. * javax/swing/plaf/basic/BasicInternalFrameUI.java: Implement. * javax/swing/plaf/basic/BasicLookAndFeel.java: Change InternalFrame and Desktop colors. 2004-06-26 David Jee <djee@redhat.com> * java/awt/Container.java (remove): Do not set component to invisible. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/tree/DefaultMutableTreeNode.java (getLeafCount): Renamed enum to e. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/plaf/basic/BasicSplitPaneDivider.java (positionForMouseEvent): Removed redundant semicolon. (continueDrag): Use method arguments. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/border/TitledBorder.java, javax/swing/filechooser/FileSystemView.java, javax/swing/plaf/basic/BasicButtonListener.java, javax/swing/plaf/basic/BasicGraphicsUtils.java, javax/swing/plaf/basic/BasicLabelUI.java, javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java, javax/swing/plaf/basic/BasicScrollBarUI.java, javax/swing/plaf/basic/BasicScrollPaneUI.java, javax/swing/plaf/basic/BasicSliderUI.java, javax/swing/plaf/basic/BasicTabbedPaneUI.java, javax/swing/plaf/basic/BasicToggleButtonUI.java, javax/swing/table/JTableHeader.java, javax/swing/text/AbstractDocument.java, javax/swing/text/DefaultCaret.java, javax/swing/text/StyledEditorKit.java, javax/swing/tree/DefaultTreeCellEditor.java: Reworked import statements. 2004-06-26 Graydon Hoare <graydon@redhat.com> * javax/swing/Box.java: Temporarily comment out code broken due to visibility bug. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/ImageIcon.java (ImageIcon): Added missing constructor. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JToggleButton.java (JToggleButton): New constructor. (getAccessibleContext): Moved documentation into javadoc. (getUIClassID): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/AbstractButton.java (getDisabledIcon): Create disabled icon if none exists yet. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/plaf/basic/BasicLookAndFeel.java (initClassDefaults): Added FormattedTextFieldUI. (loadResourceBundle): Renamed enum to e. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/plaf/basic/BasicButtonUI.java (paintIcon): Simplified. (paintText): Paint disabled button correctly. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JComponent.java (createToolTip): Use official JToolTip API. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/JToolTip.java (JToolTip): No arguments in API. (setTipText): New method. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/SwingUtilities.java (isLeftMouseButton): New method. (isMiddleMouseButton): New method. (isRightMouseButton): New method. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/AbstractButton.java, javax/swing/CellRendererPane.java, javax/swing/JCheckBoxMenuItem.java, javax/swing/JColorChooser.java, javax/swing/JComboBox.java, javax/swing/JComponent.java, javax/swing/JDesktopPane.java, javax/swing/JFileChooser.java, javax/swing/JMenu.java, javax/swing/JMenuItem.java, javax/swing/JOptionPane.java, javax/swing/JPasswordField.java, javax/swing/JPopupMenu.java, javax/swing/JProgressBar.java, javax/swing/JRadioButtonMenuItem.java, javax/swing/JScrollBar.java, javax/swing/JSeparator.java, javax/swing/JSlider.java, javax/swing/JSplitPane.java, javax/swing/JTabbedPane.java, javax/swing/JTextField.java, javax/swing/JToolBar.java, javax/swing/text/JTextComponent.java: Fixed all constructors of accessibility classes. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/ScrollPaneLayout.java: Renamed all memeber variables all over. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/Box.java (AccessibleBoxFiller): Extends AccessibleAWTComponent. (AccessibleBoxFiller.serialVersionUID): New member variable. * javax/swing/DefaultButtonModel.java (stateMask): Made protected. (listenerList): Likewise. (changeEvent): Likewise. (group): Likewise. (mnemonic): Likewise. (actionCommand): Likewise. (getListeners): New method. (getActionListeners): New method. (getItemListeners): New method. (getChangeListeners): New method. (fireItemStateChanged): Simplified. (fireActionPerformed): Simplified. (fireStateChanged): Simplified. * javax/swing/JFrame.java (JFrame): Implements WindowContants. (HIDE_ON_CLOSE): Removed. (EXIT_ON_CLOSE): Removed. (DISPOSE_ON_CLOSE): Removed. (DO_NOTHING_ON_CLOSE): Removed. (processWindowEvent): Exit with code 0. (setDefaultCloseOperation): Do security check before setting value. * javax/swing/JOptionPane.java (message): Initialize only in constructor. * javax/swing/JToolTip.java: Removed unused imports. * javax/swing/JViewport.java (serialVersionUID): New member variable. (SIMPLE_SCROLL_MODE): Made final, fixed value. (BLIT_SCROLL_MODE): Likewise. (BACKINGSTORE_SCROLL_MODE): Likewise. (scrollUnderway): Made protected. (isViewSizeSet): Likewise. * javax/swing/ListModel.java: Fixed javadoc. * javax/swing/Popup.java: Likewise. * javax/swing/RepaintManager.java (paintDirtyRegions): Don't use internal classes of java.util.AbstractMap. * javax/swing/ScrollPaneConstants.java: Reindented. * javax/swing/ScrollPaneLayout.java (viewport): Made protected. (verticalScrollBar): Made protected, renamed to vsb. (horizontalScrollBar): Made protected, renamed to hsb. (rowHeader): Made protected, renamed to rowHead. (columnHeader): Made protected, renamed to colHead. (lowerLeft): Made protected. (lowerRight): Made protected. (upperLeft): Made protected. (upperRight): Made protected. (verticalScrollBarPolicy): Made protected, renamed to vsbPolicy. (horizontalScrollBarPolicy): Made protected, renamed to hsbPolicy. 2004-06-26 Bernd Schmidt <bernds@btinternet.com> * java/awt/MediaTracker.java (imageUpdate): Only set status to LOADING if flags has SOMEBITS set. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/AbstractButton.java: Reorganized imports. * javax/swing/ActionMap.java: Likewise. * javax/swing/DefaultButtonModel.java: Likewise. * javax/swing/DefaultListModel.java: Likewise. * javax/swing/ImageIcon.java: Likewise. (serialVersionUID): New member variable. * javax/swing/JComboBox.java: Reorganized imports. * javax/swing/JComponent.java: Likewise. (ui): Made protected. (listenerList): Made protected. (TOOL_TIP_TEXT_KEY): New constant. (scrollRectToVisible): Removed redundant null check. * javax/swing/JFrame.java: Reorganized imports. * javax/swing/JInternalFrame.java: Reorganized imports. * javax/swing/JProgressBar.java: Likewise. * javax/swing/JRootPane.java: Likewise. * javax/swing/JScrollBar.java: Likewise. * javax/swing/JSeparator.java: Likewise. * javax/swing/JSlider.java: Likewise. * javax/swing/JTabbedPane.java: Likewise. * javax/swing/JTextField.java: Likewise. * javax/swing/JToolBar.java: Likewise. * javax/swing/JTree.java: Likewise. * javax/swing/JViewport.java: Likewise. * javax/swing/JWindow.java: Likewise. * javax/swing/KeyStroke.java: Likewise. * javax/swing/LookAndFeel.java: Likewise. * javax/swing/MenuSelectionManager.java: Likewise. * javax/swing/SwingUtilities.java: Likewise. * javax/swing/Timer.java: Likewise. * javax/swing/DefaultBoundedRangeModel.java: Fixed javadoc. * javax/swing/JList.java (HORIZONTAL_WRAP): Made final, fixed value. (VERTICAL): Likewise. (VERTICAL_WRAP): Likewise. 2004-06-26 Michael Koch <konqueror@gmx.de> * javax/swing/AbstractButton.java (serialVersionUID): New member variable. (AccessibleAbstractButton.serialVersionUID): Likewise. (AbstractButton): Made public. * javax/swing/Box.java (AccessibleBox.serialVersionUID): New member variable. (Filler.serialVersionUID): Likewise. * javax/swing/DefaultListSelectionModel.java (serialVersionUID): Likewise. * javax/swing/JApplet.java (serialVersionUID): Likewise. * javax/swing/JCheckBox.java (serialVersionUID): Likewise. * javax/swing/JCheckBoxMenuItem.java (serialVersionUID): Likewise. (AccessibleJCheckBoxMenuItem.serialVersionUID): Likewise. * javax/swing/JColorChooser.java (serialVersionUID): Likewise. (AccessibleJColorChooser.serialVersionUID): Likewise. * javax/swing/JComponent.java (serialVersionUID): Made private. (AccessibleJComponent.serialVersionUID): New member variable. * javax/swing/JDesktopPane.java (serialVersionUID): Likewise. * javax/swing/JDialog.java (serialVersionUID): Likewise. * javax/swing/JFormattedTextField.java (serialVersionUID): Fixed value. * javax/swing/JFrame.java (serialVersionUID): New member variable. (getDefaultCloseOpertation): Made public. * javax/swing/JLayeredPane.java (serialVersionUID): Likewise. (LAYER_PROPERTY): Made final, fixed value. (JLayeredPane): Made public. * javax/swing/JMenu.java (AccessibleJMenu.serialVersionUID): New member variable. (WinListener.serialVersionUID): Likewise. * javax/swing/JMenuBar.java (serialVersionUID): Likewise. (getComponentAtIndex): Added @deprecated tag. * javax/swing/JMenuItem.java (serialVersionUID): New member variable. (AccessibleJMenuItem.serialVersionUID): Likewise. * javax/swing/JOptionPane.java (serialVersionUID): Likewise. (AccessibleJOptionPane.serialVersionUID): Likewise. * javax/swing/JPopupMenu.java (serialVersionUID): Likewise. (AccessibleJPopupMenu.serialVersionUID): Likewise. (getPopupMenuListeners): New method. (getComponentAtIndex): Added @deprecated tag. * javax/swing/JProgressBar.java (serialVersionUID): New member variable. (AccessibleJProgressBar.serialVersionUID): Likewise. * javax/swing/JRadioButt
Diffstat (limited to 'java')
-rw-r--r--java/applet/Applet.java40
-rw-r--r--java/awt/AWTEvent.java12
-rw-r--r--java/awt/BorderLayout.java12
-rw-r--r--java/awt/Button.java24
-rw-r--r--java/awt/Component.java6
-rw-r--r--java/awt/Container.java5
-rw-r--r--java/awt/GridBagLayout.java21
-rw-r--r--java/awt/MediaTracker.java19
-rw-r--r--java/awt/MenuItem.java5
-rw-r--r--java/awt/TextArea.java30
-rw-r--r--java/awt/TextComponent.java1
11 files changed, 98 insertions, 77 deletions
diff --git a/java/applet/Applet.java b/java/applet/Applet.java
index 009b18ced..5990c6392 100644
--- a/java/applet/Applet.java
+++ b/java/applet/Applet.java
@@ -78,11 +78,6 @@ public class Applet extends Panel
private transient AppletStub stub;
/**
- * The dimensions passed to this applet through its HTML tag.
- */
- private transient Dimension dimensions;
-
- /**
* The accessibility context for this applet.
*
* @serial the accessibleContext for this
@@ -462,41 +457,6 @@ public class Applet extends Panel
s.defaultReadObject();
}
- private Dimension getDimensions ()
- {
- if (dimensions == null)
- {
- int width = Integer.parseInt(stub.getParameter("width"));
- int height = Integer.parseInt(stub.getParameter("height"));
-
- dimensions = new Dimension(width, height);
- }
-
- return dimensions;
- }
-
- /**
- * Returns an instance of {@link Dimension} representing the
- * applet's width and height parameters.
- *
- * @return the applet's preferred size
- */
- public Dimension preferredSize()
- {
- return stub == null ? super.preferredSize () : getDimensions ();
- }
-
- /**
- * Returns an instance of {@link Dimension} representing the
- * applet's width and height parameters.
- *
- * @return the applet's minimum size
- */
- public Dimension minimumSize()
- {
- return stub == null ? super.minimumSize () : getDimensions ();
- }
-
/**
* This class provides accessibility support for Applets, and is the
* runtime type returned by {@link #getAccessibleContext()}.
diff --git a/java/awt/AWTEvent.java b/java/awt/AWTEvent.java
index a084dcf24..675c27f95 100644
--- a/java/awt/AWTEvent.java
+++ b/java/awt/AWTEvent.java
@@ -238,8 +238,16 @@ public abstract class AWTEvent extends EventObject
*/
public String toString ()
{
- return getClass ().getName () + "[" + paramString () + "] on "
- + ((Component) source).getName ();
+ String string = null;
+
+ if (source instanceof Component)
+ string = getClass ().getName () + "[" + paramString () + "] on "
+ + ((Component) source).getName ();
+ else if (source instanceof MenuComponent)
+ string = getClass ().getName () + "[" + paramString () + "] on "
+ + ((MenuComponent) source).getName ();
+
+ return string;
}
/**
diff --git a/java/awt/BorderLayout.java b/java/awt/BorderLayout.java
index 38e4de742..a023cbb05 100644
--- a/java/awt/BorderLayout.java
+++ b/java/awt/BorderLayout.java
@@ -592,13 +592,21 @@ layoutContainer(Container target)
int x1 = i.left;
int x2 = x1 + w.width + hgap;
- int x3 = Math.max(x2 + w.width + hgap, t.width - i.right - e.width);
+ int x3;
+ if (t.width <= i.right + e.width)
+ x3 = x2 + w.width + hgap;
+ else
+ x3 = t.width - i.right - e.width;
int ww = t.width - i.right - i.left;
int y1 = i.top;
int y2 = y1 + n.height + vgap;
int midh = Math.max(e.height, Math.max(w.height, c.height));
- int y3 = Math.max(y2 + midh + vgap, t.height - i.bottom - s.height);
+ int y3;
+ if (t.height <= i.bottom + s.height)
+ y3 = y2 + midh + vgap;
+ else
+ y3 = t.height - i.bottom - s.height;
int hh = y3-y2-vgap;
setBounds(center, x2, y2, x3-x2-hgap, hh);
diff --git a/java/awt/Button.java b/java/awt/Button.java
index a521c8e4f..54b201ed1 100644
--- a/java/awt/Button.java
+++ b/java/awt/Button.java
@@ -81,6 +81,11 @@ private String label;
// List of ActionListeners for this class.
private transient ActionListener action_listeners;
+ /*
+ * The number used to generate the name returned by getName.
+ */
+ private static transient long next_button_number = 0;
+
/*************************************************************************/
/*
@@ -305,9 +310,24 @@ dispatchEventImpl(AWTEvent e)
protected String
paramString()
{
- return ("label=" + getLabel() + ",actionCommand=" + getActionCommand()
- + "," + super.paramString());
+ return getName () + "," + getX () + "," + getY () + ","
+ + getWidth () + "x" + getHeight () + ",label=" + getLabel ();
}
+ /**
+ * Generate a unique name for this button.
+ *
+ * @return A unique name for this button.
+ */
+ String generateName ()
+ {
+ return "button" + getUniqueLong ();
+ }
+
+ private static synchronized long getUniqueLong ()
+ {
+ return next_button_number++;
+ }
+
} // class Button
diff --git a/java/awt/Component.java b/java/awt/Component.java
index 3ca2b4f7a..f3153da59 100644
--- a/java/awt/Component.java
+++ b/java/awt/Component.java
@@ -941,7 +941,7 @@ public abstract class Component
{
if (foreground != null)
return foreground;
- return parent == null ? null : parent.getForeground();
+ return parent == null ? SystemColor.windowText : parent.getForeground();
}
/**
@@ -982,7 +982,7 @@ public abstract class Component
{
if (background != null)
return background;
- return parent == null ? null : parent.getBackground();
+ return parent == null ? SystemColor.window : parent.getBackground();
}
/**
@@ -1031,7 +1031,7 @@ public abstract class Component
if (parent != null)
return parent.getFont ();
else
- return new Font ("Fixed", Font.PLAIN, 12);
+ return new Font ("Dialog", Font.PLAIN, 12);
}
/**
diff --git a/java/awt/Container.java b/java/awt/Container.java
index 0482e6547..ffd81b468 100644
--- a/java/awt/Container.java
+++ b/java/awt/Container.java
@@ -876,11 +876,6 @@ public class Container extends Component
{
return locate (x, y);
}
-
- public Component getComponentAt(int index)
- {
- return component[index];
- }
/**
* Returns the component located at the specified point. This is done
diff --git a/java/awt/GridBagLayout.java b/java/awt/GridBagLayout.java
index 301e71318..b98359c1b 100644
--- a/java/awt/GridBagLayout.java
+++ b/java/awt/GridBagLayout.java
@@ -790,13 +790,26 @@ public class GridBagLayout
info.rowWeights);
} // end of STEP 4
- calcCellSizes (info.colWidths, info.colWeights, parentDim.width);
- calcCellSizes (info.rowHeights, info.rowWeights, parentDim.height);
+ // Adjust cell sizes iff parent size not zero.
+ if (parentDim.width > 0 && parentDim.height > 0)
+ {
+ calcCellSizes (info.colWidths, info.colWeights, parentDim.width);
+ calcCellSizes (info.rowHeights, info.rowWeights, parentDim.height);
+ }
int totalWidth = sumIntArray(info.colWidths);
int totalHeight = sumIntArray(info.rowHeights);
- info.pos_x = parentInsets.left + (parentDim.width - totalWidth) / 2;
- info.pos_y = parentInsets.top + (parentDim.height - totalHeight) / 2;
+
+ // Make sure pos_x and pos_y are never negative.
+ if (totalWidth >= parentDim.width)
+ info.pos_x = parentInsets.left;
+ else
+ info.pos_x = parentInsets.left + (parentDim.width - totalWidth) / 2;
+
+ if (totalHeight >= parentDim.height)
+ info.pos_y = parentInsets.top;
+ else
+ info.pos_y = parentInsets.top + (parentDim.height - totalHeight) / 2;
// DEBUG
//dumpLayoutInfo (info);
diff --git a/java/awt/MediaTracker.java b/java/awt/MediaTracker.java
index b1157349b..d1df8b383 100644
--- a/java/awt/MediaTracker.java
+++ b/java/awt/MediaTracker.java
@@ -81,12 +81,17 @@ public class MediaTracker implements java.io.Serializable
status = ERRORED | COMPLETE;
else if ((flags & ALLBITS) != 0)
status = COMPLETE;
- else
+ else if ((flags & SOMEBITS) != 0)
status = LOADING;
-
- synchronized (MediaTracker.this)
+ else
+ status = 0;
+
+ if ((status & COMPLETE) == COMPLETE)
{
- MediaTracker.this.notifyAll();
+ synchronized (MediaTracker.this)
+ {
+ MediaTracker.this.notifyAll();
+ }
}
// If status is not COMPLETE then we need more updates.
return (status & COMPLETE) == 0;
@@ -106,7 +111,8 @@ public class MediaTracker implements java.io.Serializable
e.next = head;
head = e;
// Start tracking image status.
- target.checkImage(image, e);
+ int flags = target.checkImage(image, e);
+ e.imageUpdate(image, flags, -1, -1, -1, -1);
}
public void addImage(Image image, int id, int width, int height)
@@ -119,7 +125,8 @@ public class MediaTracker implements java.io.Serializable
e.height = height;
head = e;
// Start tracking image status.
- target.checkImage(image, width, height, e);
+ int flags = target.checkImage(image, width, height, e);
+ e.imageUpdate(image, flags, -1, -1, width, height);
}
public boolean checkAll()
diff --git a/java/awt/MenuItem.java b/java/awt/MenuItem.java
index 4defc3827..8511f698f 100644
--- a/java/awt/MenuItem.java
+++ b/java/awt/MenuItem.java
@@ -424,6 +424,11 @@ dispatchEventImpl(AWTEvent e)
&& (action_listeners != null
|| (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
processEvent(e);
+
+ // Send the event to the parent menu if it has not yet been
+ // consumed.
+ if (!e.isConsumed ())
+ ((Menu) getParent ()).processEvent (e);
}
/**
diff --git a/java/awt/TextArea.java b/java/awt/TextArea.java
index f27c29695..6355376df 100644
--- a/java/awt/TextArea.java
+++ b/java/awt/TextArea.java
@@ -103,29 +103,33 @@ public class TextArea extends TextComponent implements java.io.Serializable
private static transient long next_text_number = 0;
/**
- * Initialize a new instance of <code>TextArea</code> that is empty
- * and is one row by one column. Both horizontal and vertical
+ * Initialize a new instance of <code>TextArea</code> that is empty.
+ * Conceptually the <code>TextArea</code> has 0 rows and 0 columns
+ * but its initial bounds are defined by its peer or by the
+ * container in which it is packed. Both horizontal and vertical
* scrollbars will be displayed.
*
- * @exception HeadlessException If GraphicsEnvironment.isHeadless () is true,
+ * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
*/
public TextArea ()
{
- this ("", 1, 1, SCROLLBARS_BOTH);
+ this ("", 0, 0, SCROLLBARS_BOTH);
}
/**
- * Initialize a new instance of <code>TextArea</code> that initially
- * contains the specified text. Both horizontal and veritcal
- * scrollbars will be displayed.
+ * Initialize a new instance of <code>TextArea</code> that contains
+ * the specified text. Conceptually the <code>TextArea</code> has 0
+ * rows and 0 columns but its initial bounds are defined by its peer
+ * or by the container in which it is packed. Both horizontal and
+ * veritcal scrollbars will be displayed.
*
* @param text The text to display in this text area.
*
- * @exception HeadlessException If GraphicsEnvironment.isHeadless () is true,
+ * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
*/
public TextArea (String text)
{
- this (text, 1, text.length (), SCROLLBARS_BOTH);
+ this (text, 0, 0, SCROLLBARS_BOTH);
}
/**
@@ -137,7 +141,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
* @param rows The number of rows in this text area.
* @param columns The number of columns in this text area.
*
- * @exception HeadlessException If GraphicsEnvironment.isHeadless () is true,
+ * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
*/
public TextArea (int rows, int columns)
{
@@ -154,7 +158,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
* @param rows The number of rows in this text area.
* @param columns The number of columns in this text area.
*
- * @exception HeadlessException If GraphicsEnvironment.isHeadless () is true,
+ * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
*/
public TextArea (String text, int rows, int columns)
{
@@ -175,7 +179,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
* SCROLLBARS_BOTH, SCROLLBARS_VERTICAL_ONLY,
* SCROLLBARS_HORIZONTAL_ONLY, SCROLLBARS_NONE.
*
- * @exception HeadlessException If GraphicsEnvironment.isHeadless () is true,
+ * @exception HeadlessException if GraphicsEnvironment.isHeadless () is true
*/
public TextArea (String text, int rows, int columns, int scrollbarVisibility)
{
@@ -184,7 +188,7 @@ public class TextArea extends TextComponent implements java.io.Serializable
if (GraphicsEnvironment.isHeadless ())
throw new HeadlessException ();
- if (rows < 1 || columns < 0)
+ if (rows < 0 || columns < 0)
throw new IllegalArgumentException ("Bad row or column value");
if (scrollbarVisibility != SCROLLBARS_BOTH
diff --git a/java/awt/TextComponent.java b/java/awt/TextComponent.java
index 0a410a44b..9cdb507f3 100644
--- a/java/awt/TextComponent.java
+++ b/java/awt/TextComponent.java
@@ -141,6 +141,7 @@ setText(String text)
TextComponentPeer tcp = (TextComponentPeer)getPeer();
if (tcp != null)
tcp.setText(text);
+ setCaretPosition(0);
}
/*************************************************************************/