JDK-4131642 : Need ability to create a Frame on a screen other than the default screen
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_2.6
  • CPU: generic,sparc
  • Submitted: 1998-04-22
  • Updated: 1999-07-15
  • Resolved: 1999-07-15
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.3.0 betaFixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The new AWT classes in JDK 1.2 provide hooks for multiple screens via an
array of screen GraphicsDevice objects.  It is not currently possible,
however, to create a Frame on a screen other than the default screen.
The following code will produce a list of all screens on the system:

    GraphicsDevice allGraphicsDevices[] =
	GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();

However, there is no means to create a Frame using one of these
GraphicsDevices.  One of the following (or an equivalent mechanism)
is needed:

    1.	A Frame constructor that takes a GraphicsDevice argument

    2.	A GraphicsDevice method to create a Frame

    3.	GraphicsEnvironment method to change the default screen
	to the specified GraphicsDevice

We believe that the first choice is the preferred one.  We propose that
the following four new constructors be added.  Two in Frame and two in JFrame.

	public Frame(String title, GraphicsDevice graphicsDevice);
	public Frame(GraphicsDevice graphicsDevice);

	public JFrame(String title, GraphicsDevice graphicsDevice);
	public JFrame(GraphicsDevice graphicsDevice);

Additionally, there should be a new method, probably in Window, that
returns the Graphics device on which that Window was created.

	public GraphicsDevice getGraphicsDevice();


[kevin.rushforth@Eng 1999-02-18]
Since there is a JWindow() constructor without any arguments, that is, one
that doesn't take another JFrame or JWindow, there should also be a
corresponding JWindow constructor that takes a GraphicsDevice:

	public JWindow(GraphicsDevice graphicsDevice);


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

SUGGESTED FIX [kevin.rushforth@Eng 1999-02-05] I have added an attachment that contains the modifications that the JAI and Java 3D teams made to the JDK 1.2 source code to implement enough multi-screen support for the Java 3D 8-headed demo. This modification has serious limitations (it breaks all of the GraphicsConfig stuff and it requires that the framebuffers be homogeneous in type and resolution), but it may be useful to you in implementing the RFE. I also included the diffs. The following files were modified. src/share/classes/java/awt/Frame.java src/solaris/native/sun/awt/awt.h src/solaris/native/sun/awt/awt_Frame.c src/solaris/native/sun/awt/awt_GraphicsEnv.c Note that the new getDevice routine is implemented in Frame rather than Window, which is where it probably should be implemented.
11-06-2004

PUBLIC COMMENTS The new AWT classes in JDK 1.2 provide hooks for multiple screens via an array of screen GraphicsDevice objects. It is not currently possible, however, to create a Frame on a screen other than the default screen.
10-06-2004

EVALUATION I think we should add a method to Component to return its graphics configuration instead of a method on Frame to return its device. You can get from a Config to the Device so that solves a larger problem instead. Also, I think it would be better if Frame took a GraphicsConfig (which implies a Device) instead of a device object. With the suggested fixes, there is still no way to control the Config of a Frame on a screen that has multiple available configurations. jim.graham@Eng 1999-02-18
18-02-1999