SHIRAKAMI Kazuhisa <snow.trad.pfu.fujitsu.co.jp!###@###.###>
Solaris only: Keyboard caret doesn't blink in text component when there is no activity from
the keyboard
Steps to reproduce
Compile and run the attached code
<Click> on Text Field in top of applet
Type a few characters
wait
// Note: I beam caret should be blinking.
/* Keyboard caret test */
import java.awt.*;
import java.applet.Applet;
public class CaretTest extends Applet
{
public void init()
{
setLayout( new BorderLayout() );
add("North", new TextField() );
add("Center", new TextArea() );
resize(400, 400);
}
public static void main(String args[])
{
AppletFrame.startApplet("CaretTest", "Caret Test", args);
}
}
/* Generic Applet to Application Frame
* @(#)AppletFrame.java 1.4 12/02/95 15:28:07
* @author Kevin A. Smith
*
*/
import java.awt.Frame;
import java.awt.Event;
import java.awt.Dimension;
import java.applet.Applet;
// Applet to Application Frame window
class AppletFrame extends Frame
{
public static void startApplet(String className,
String title,
String args[])
{
// local variables
Applet a;
Dimension appletSize;
try
{
// create an instance of your applet class
a = (Applet) Class.forName(className).newInstance();
}
catch (ClassNotFoundException e) { return; }
catch (InstantiationException e) { return; }
catch (IllegalAccessException e) { return; }
// initialize the applet
a.init();
a.start();
// create new application frame window
AppletFrame f = new AppletFrame(title);
// add applet to frame window
f.add("Center", a);
// resize frame window to fit applet
// assumes that the applet sets its own size
// otherwise, you should set a specific size here.
appletSize = a.size();
f.pack();
f.resize(appletSize);
// show the window
f.show();
} // end startApplet()
// constructor needed to pass window title to class Frame
public AppletFrame(String name)
{
// call java.awt.Frame(String) constructor
super(name);
}
// needed to allow window close
public boolean handleEvent(Event e)
{
// Window Destroy event
if (e.id == Event.WINDOW_DESTROY)
{
// exit the program
System.exit(0);
return true;
}
// it's good form to let the super class look at any
// unhandled events
return super.handleEvent(e);
} // end handleEvent()
} // end class AppletFrame
Solaris only: Keyboard caret doesn't blink in text component when there is no activity from
the keyboard
Steps to reproduce
Compile and run the attached code
<Click> on Text Field in top of applet
Type a few characters
wait
// Note: I beam caret should be blinking.
/* Keyboard caret test */
import java.awt.*;
import java.applet.Applet;
public class CaretTest extends Applet
{
public void init()
{
setLayout( new BorderLayout() );
add("North", new TextField() );
add("Center", new TextArea() );
resize(400, 400);
}
public static void main(String args[])
{
AppletFrame.startApplet("CaretTest", "Caret Test", args);
}
}
/* Generic Applet to Application Frame
* @(#)AppletFrame.java 1.4 12/02/95 15:28:07
* @author Kevin A. Smith
*
*/
import java.awt.Frame;
import java.awt.Event;
import java.awt.Dimension;
import java.applet.Applet;
// Applet to Application Frame window
class AppletFrame extends Frame
{
public static void startApplet(String className,
String title,
String args[])
{
// local variables
Applet a;
Dimension appletSize;
try
{
// create an instance of your applet class
a = (Applet) Class.forName(className).newInstance();
}
catch (ClassNotFoundException e) { return; }
catch (InstantiationException e) { return; }
catch (IllegalAccessException e) { return; }
// initialize the applet
a.init();
a.start();
// create new application frame window
AppletFrame f = new AppletFrame(title);
// add applet to frame window
f.add("Center", a);
// resize frame window to fit applet
// assumes that the applet sets its own size
// otherwise, you should set a specific size here.
appletSize = a.size();
f.pack();
f.resize(appletSize);
// show the window
f.show();
} // end startApplet()
// constructor needed to pass window title to class Frame
public AppletFrame(String name)
{
// call java.awt.Frame(String) constructor
super(name);
}
// needed to allow window close
public boolean handleEvent(Event e)
{
// Window Destroy event
if (e.id == Event.WINDOW_DESTROY)
{
// exit the program
System.exit(0);
return true;
}
// it's good form to let the super class look at any
// unhandled events
return super.handleEvent(e);
} // end handleEvent()
} // end class AppletFrame