< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java

Print this page

        

*** 93,110 **** setEditable(target.isEditable()); // After this line we should not change the component's text firstChangeSkipped = true; } @Override public void dispose() { XToolkit.specialPeerMap.remove(xtext); // visible caret has a timer thread which must be stopped xtext.getCaret().setVisible(false); - xtext.removeNotify(); super.dispose(); } void initTextField() { setVisible(target.isVisible()); --- 93,110 ---- setEditable(target.isEditable()); // After this line we should not change the component's text firstChangeSkipped = true; + AWTAccessor.getComponentAccessor().setPeer(xtext, this); } @Override public void dispose() { XToolkit.specialPeerMap.remove(xtext); // visible caret has a timer thread which must be stopped xtext.getCaret().setVisible(false); super.dispose(); } void initTextField() { setVisible(target.isVisible());
*** 257,288 **** if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("target="+ target + ", old=" + background + ", new=" + c); } background = c; if (xtext != null) { xtext.setBackground(c); xtext.setSelectedTextColor(c); } repaintText(); } @Override public void setForeground(Color c) { foreground = c; if (xtext != null) { xtext.setForeground(foreground); xtext.setSelectionColor(foreground); xtext.setCaretColor(foreground); } repaintText(); } @Override public void setFont(Font f) { synchronized (getStateLock()) { font = f; ! if (xtext != null) { xtext.setFont(font); } } xtext.validate(); } --- 257,292 ---- if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("target="+ target + ", old=" + background + ", new=" + c); } background = c; if (xtext != null) { + if (xtext.getBackground() != c) { xtext.setBackground(c); + } xtext.setSelectedTextColor(c); } repaintText(); } @Override public void setForeground(Color c) { foreground = c; if (xtext != null) { + if (xtext.getForeground() != c) { xtext.setForeground(foreground); + } xtext.setSelectionColor(foreground); xtext.setCaretColor(foreground); } repaintText(); } @Override public void setFont(Font f) { synchronized (getStateLock()) { font = f; ! if (xtext != null && xtext.getFont() != f) { xtext.setFont(font); } } xtext.validate(); }
< prev index next >