JDK-4116067 : Swing and AWT remote ( via X ) display problems
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.2.0,1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.6,solaris_7
  • CPU: generic,sparc
  • Submitted: 1998-02-27
  • Updated: 1999-01-14
  • Resolved: 1999-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.2.0 1.2fcsFixed
Related Reports
Relates :  
Description

Name: rm29839			Date: 02/27/98


Hi,


When attempting to execute an application ( which incidentally is
an applet ) remotely via X windows yields differing results
when executed by a 1.1.4 virtual machine as opposed to a 1.2beta2.

Local execution, i.e the display host is the also host where the
code is running presented no problems for either JDK version. This
was NOT the case for remote execution, i.e. when the display host
is different to the host where the code is executing.

Essentially, when run under 1.1.4 presentation is as expected; the
component is rendered properly and the window is properly formed.
In contrast execution under 1.2beta2 results in incomplete
component rendering and window ( frame ) formation. The resultant
"application" varies according to method of remote access, e.g.
telnet, ssh etc., desktop environment and container ( AWT or Swing )
type used. In summary, the problems appear to affect Swing containers
more than AWT containers. The difficulties are most pronounced under
"secure shell" ( ssh ) and when the display host is a DEC, however
SUNs are not immune to these problems. In a full-scale interface, this
anomaly is usually manifest by incomplete display ( usually missing
Swing components ) of the interface.

The results in detail are presented below in the form of two (2)
scenarios. Scenario 2 has no local execution tests as this required
a Digital Unix version of the JDK and was deemed inappropriate for
this bug report. Only anomalous behaviour is explicitly stated.
Behaviour that is normal is NOT commented on. Swing 0.7 was used in
both scenarios where Swing components were used.

The code has not been run as an applet.

A possibly related bug report regarding this error is 4098506.


Regards,

Mark A.



Scenario 1
----------

Display Host          : SUN Sparc Ultra 2
Code Executing Host   : SUN Sparc Ultra 1
X Windows Version     : X11R6.3
Desktop               : Common Desktop Environment ( CDE )
Secure Shell Version  : 1.2.17
AWT Containers        : Frame and Applet
Swing Containers      : JFrame and JApplet

 -----------------------------------------------------------------
| JDK   | Container | Local   | Remote Display                    |
|       | Type      | Display | ----------------------------------|
|       |           |         | ssh     | rlogin, rsh and telnet  |
|-----------------------------------------------------------------|
| 1.1.4 | AWT       | OK      | OK      | OK                      |
|-----------------------------------------------------------------|
| 1.1.4 | Swing     | OK      | OK      | OK                      |
|-----------------------------------------------------------------|
| 1.2B2 | AWT       | OK      | OK      | OK                      |
|-----------------------------------------------------------------|
| 1.2B2 | Swing     | OK      | Slider  | OK                      |
|       |           |         | has no  |                         |
|       |           |         | knob    |                         |
 -----------------------------------------------------------------


Scenario 2
----------

Display Host          : DEC Alpha 3500
Code Executing Host   : SUN Sparc Ultra 2
X Windows Version     : X11R6
Desktop               : FVWM95-2
Secure Shell Version  : 1.2.20
AWT Containers        : Frame and Applet
Swing Containers      : JFrame and JApplet

 -----------------------------------------------------------------
| JDK   | Container | Local   | Remote Display                    |
|       | Type      | Display | ----------------------------------|
|       |           |         | ssh     | rlogin, rsh and telnet  |
|-----------------------------------------------------------------|
| 1.1.4 | AWT       | N/A     | OK      | OK                      |
|-----------------------------------------------------------------|
| 1.1.4 | Swing     | N/A     | OK      | OK                      |
|-----------------------------------------------------------------|
| 1.2B2 | AWT       | N/A     | Frame appears but no minimise,    |
|       |           |         | maximise and kill icons/buttons   |
|       |           |         | appear in the top right hand      |
|       |           |         | corner. Frame's X menu in the top |
|       |           |         | left hand corner appears disabled |
|       |           |         | but all options are enabled.      |
|       |           |         | Cannot resize window using cursor |
|       |           |         | and left hand mouse button.       |
|-----------------------------------------------------------------|
| 1.2B2 | Swing     | N/A     | Slider  | Slider's colour is      |
|       |           |         | has no  | orange rather than the  |
|       |           |         | knob.   | motif default ( a       |
|       |           |         |         | purplish grey ).        |
|       |           |         |-----------------------------------|
|       |           |         | Frame appearance and behaviour as |
|       |           |         | per the results for 1.2B2 AWT.    |
 -----------------------------------------------------------------



1. To reproduce the problem:

       a)  Set the 'JDK_HOME' variable to point to the home
           of JDK1.1.4
       b)  Compile the following code, as listed in point 2.
       c)  Login using 'telnet' to the host where the code is
           to be executed.
       d)  Execute the application using the same version of
           the JDK that was used to compile it.
       e)  Repeat steps c) and d) for 'rsh', 'rlogin' and 'ssh'.
           Remember to set the 'DISPLAY' variable on the code
           executing host to the host where the "application" is
           to be displayed for 'rsh' and 'rlogin'.
       f)  Repeat all of the above steps, setting 'JDK_HOME'
           to the home of JDK1.2beta2.

The CLASSPATH in ALL tests was set to include 'classes.zip',
'swing.jar', 'motif.jar' and the current directory.


2. Source code demonstrating problem:

import com.sun.java.swing.JApplet;
import com.sun.java.swing.JFrame;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.JSlider;

import java.applet.Applet;
import java.awt.Frame;


// public class RemoteGUITest extends Applet
public class RemoteGUITest extends JApplet
{
   public RemoteGUITest ()
   {
   }

   public void init ()
   {
      JSlider  Sldr = new JSlider (JSlider.HORIZONTAL, 1, 20, 10);
      // add ("Center",Sldr);
      getContentPane ().add ("Center",Sldr);
   }

   public static void main  (String []  Args)
   {
      // Frame          ApplnWindow = new Frame ();
      // RemoteGUITest  Applt = new RemoteGUITest ();

      JFrame         ApplnWindow = new JFrame ();
      RemoteGUITest  Applt = new RemoteGUITest ();


      /* Applet */
      /* This works with java.applet.Applet but NOT   */
      /* com.sun.java.swing.JApplet! The applet's     */
      /* 'getContentPane ()' generates a Null Pointer */
      /* Exception.                                   */
      /*
      Applt.init ();

      // ApplnWindow.add ("Center", Applt);
      ApplnWindow.getContentPane ().add ("Center", Applt);
      // ApplnWindow.pack();
      ApplnWindow.setSize(250, 50);
      ApplnWindow.setVisible (true);
      */

      /* JApplet */
      /* By the way of explanation the following magic is  */
      /* my workaround to a bug preventing the execution   */
      /* of a JApplet as an application. A bug report      */
      /* ( 4106368 ) was submitted but the bug was found   */
      /* to be unreproducible. I require it to demonstrate */
      /* these errors, and it doesn't affect normal applet */
      /* as an application execution. Otherwise it should  */
      /* be ignored.                                       */
      // ApplnWindow.add ("Center", Applt);
      ApplnWindow.getContentPane ().add ("Center", Applt);
      // ApplnWindow.pack ();
      ApplnWindow.setSize (250, 50);
      ApplnWindow.setVisible (true);
      ApplnWindow.setVisible (false);
      Applt.init ();
      ApplnWindow.setVisible (true);
   }
}


3. Error message generated:

None.


4. Trace information is generated by the program:

None.


5. Relevant configuration information:

Configuration information is available in the scenarios
presented above.
(Review ID: 25742)
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.2fcs FIXED IN: 1.2fcs INTEGRATED IN: 1.2fcs
14-06-2004

WORK AROUND Name: rm29839 Date: 02/27/98 None found. ======================================================================
11-06-2004

EVALUATION Color swapping problem on remote X display existed, because we didn't check for the byteOrder of client and server and took appropriate action. This is now done in awt_Grapics.c for Solaris. thanh.nguyen@Eng 1998-08-12
12-08-1998