Kannan's Weblog
Making a non-focusable Window focusable
I recently came across another issue from a customer where an awt Window component was not getting focus even when requested.
java.awt.Window or javax.swing.JWindow class is typically used by customer for creating customized popup menus or tooltips or as a splash screen (We now have SplashScreen class introduced in java.awt package in 6.0).
Scenario:
A Window component is created with lots of awt Label components inside it where each Label component is treated as a menu item
It's well documented that for a Window to be focusable, its owner (either a Frame or another Window object) needs to be showing on the screen.
In this case, the customer had a Frame as its owner but still couldn't make the Window focusable. Why?
Reason:
There is one more condition for a Window component to be focusable that users may not remember and is documented somewhere in the middle of the AWT Focus specification.
These are the wordings in AWT Focus Specification:
"Every Window which is not a Frame or Dialog, but whose nearest
owning Frame or Dialog is showing on the screen, and which has at
least one Component in its focus traversal cycle, is also focusable by
default. "
Since customer's Window contains only Label(s) and a panel
(none of which are focusable by default), the window is not focusable
and hence even adding keylistener to the Window object has no effect.
Solution:
There are two solutions to this:
1. Call Window.setFocusable(true) OR
2. Reset the focus traversal policy of the window to
ContainerOrderFocusTraversalPolicy.
The first one is much simpler I believe.
Thanks,
Kannan
Posted at 06:59PM Apr 22, 2008 by Kannan Balasubramanian in Sun | Comments[0]
Post keyevent to system event queue (AWT)
I recently came across an issue from a customer where an attempt to redirect a keyevent to another component (by posting it to the system event queue) resulted in an infinite recursion of the event getting posted.
Consider a simple scenario as below:
final EventQueue eventQ = Toolkit.getDefaultToolkit().getSystemEventQueue();
TextField tf = new TextField("This is a test");
tf.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent ev) {
KeyEvent keyevent = new KeyEvent (
applet, ev.getID(), ev.getWhen(),
ev.getModifiers(), ev.getKeyCode(),
ev.getKeyChar()
);
System.out.println("keyPressed: " + ev.getClass());
eventQ.postEvent(keyevent);
}
});
Warning! Running the above code may generate the keyPressed message on console infinite times.
Reason:
Note that the keyevent on the textfield is being redirected to an applet. Users may normally expect the keyPressed event of the applet to get called as a result of this (assuming applet has implemented KeyListener) but that may not really happen in reality. In awt implementation, the keyevent is always sent to the focus owner. In this case obviously TextField is the focus owner at the point when keyPressed event is called. So even though an attempt is made to redirect the event to an applet, awt (internally) will post the event back to the focus owner (in this case TextField) and hence results in an infinite recursion.
Conclusion:
Never post key event to a component until you are sure that the component is the focus owner
Solution:
We strongly encourage developers to use KeyEventDispatcher (a keyevent preprocessor) or KeyEventPostProcessor (post processor) to handle such cases and redirect the event directly to the targetted component without posting it to the system event queue.
Thanks,
Kannan
Posted at 02:02PM Jan 10, 2008 by Kannan Balasubramanian in Personal | Comments[0]
JavaFX animation (continued)
Another typical bouncing ball kind of application that I have come up with. Nothing fancy about this application. I have written the application in both JavaFX and Java just to see as to what it takes to come up an application with the same output on both these languages.
Similar
to my earlier sample on Solar System simulation, there are a few
attributes made configurable with some keypresses. You will find
instructions on those at the top left of the application
In order to compare the output, run both the apps from two different terminals. JavaFX script occupies the first half of the screen and the java app occupies the other half. Running both of them simultaneously would occupy the fullscreen.
Attaching screenshot of the combined application:
StarField.fx and StarField.java
Thanks,
Kannan
Posted at 11:58PM Dec 21, 2007 by Kannan Balasubramanian in Sun | Comments[0]
jhat queries from command line
There are several articles available on jhat and its usage
http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html
jhat typically requires to you to run the server from a console and launch a web browser to walk through the heap dumps and run various OQL queries. There maybe a lot of console (non-UI) based developers wanting to run queries or walk through the heap dump from command line and maybe redirect the various results to a file, thereby staying away from the browser. This could also be useful in cases where the heap dumps are quite huge and the browser UI takes a lot of time to load giving a "browser hang" impression to the user at times.
I have written one such tool that I currently call as JQuery and facilitates performing most of the operations from command line that you would normally do with mouse clicks on the browser
The tool covers most (if not all) of the common functionalities and infact interacts directly with jhat for every heap data output that you look for.
Note that the tool currently dumps output in html format and depending on the needs, I can make it dump output in text format for better readability.
How to run the tool:
- Preqrequisties: You need to have jhat server running on a heap dump obtained using jmap
- Compile and run the below JQuery class and connect to jhat server (see java JQuery -help for details)
- Once you are connected, -help <enter> should give you list of commands that you can use to walk through heap dumps and/or redirect the output to a file
Would appreciate any comments about the functionality/improvements of this tool.
Thanks,
Kannan
Posted at 02:06AM Dec 16, 2007 by Kannan Balasubramanian in Sun | Comments[0]
JMX + assistive technologies for visualizing AWT events
Jean-Francois Denise has written an excellent blog for visualizing AWT events on a targetted application at:
http://blogs.sun.com/jmxnetbeans/entry/jmx2awt_mbean
The approach requires a very small modification in the targetted application in order to deploy the MBean:
AWTEvents mbean = AWTEvents.getDefault();
ManagementFactory.getPlatformMBeanServer().registerMBean(mbean,new ObjectName(":type=AWTEvents");
If the targetted application is not to be touched at all but still achieve the same goal as in the above blog, assistive technologies could be used:
So assuming I write a JMX agent as below:
import javax.management.*;
import java.lang.management.*;
public class AWTEventAgent {
private MBeanServer mbs = null;
public AWTEventAgent() {
// Create an MBeanServer and HTML adaptor (J2SE 1.4)
mbs = ManagementFactory.getPlatformMBeanServer();
// Unique identification of MBeans
AWTEvents mbean = AWTEvents.getDefault();
ObjectName beanName = null;
try {
// Uniquely identify the MBeans and register them with the MBeanServer
beanName = new ObjectName("AWTEventAgent:type=AWTEvents");
mbs.registerMBean(mbean, beanName);
} catch(Exception e) {
e.printStackTrace();
}
}
}
Compile the file and launch your targetted application say SwingSet2.jar for e.g as below:
D:\jdk1.6.0\demo\jfc\SwingSet2>java -Djavax.accessibility.assistive_technologies=AWTEventAgent -Xbootclasspath/p:
The above syntax is on Windows and a similar approach on other platforms (Solaris/Linux) using the appropriate path separator could be done.
Note that we use the system property -Djavax.accessibility.assistive_technologies which points to the AWTEventAgent class and it needs to be loaded on startup by specifying the Xbootclasspath to its location.
In jdk 6.0 and onwards, it should be possible to load the above agent in the targetted application using attach on demand feature at run time. I will try to come out with a sample code for it shortly.
Thanks,
Kannan
Posted at 10:43PM Mar 11, 2007 by Kannan Balasubramanian in Sun | Comments[1]
Creating GUI applications using jrunscript
I have always been looking forward to a scripting language for creating and playing with Java GUI applications easily. jrunscript introduced in JDK6.0 is a powerful command line scripting shell. A.Sundarajan has written very useful blogs on jrunscript
http://blogs.sun.com/sundararajan/entry/command_line_script_shell_in
In this blog, my attempt is to give an introduction on writing simple GUI applications using JavaScript.
If you have read the above blog, you would know that a group of commands could be grouped into a script file (just like a bat or shell script file)
Create a simple frame of size 400*400 with a button added to it:
importPackage(javax.swing);
importPackage(java.lang);
frame = new JFrame("JFrame");
frame.setSize(400, 400);
btn = new JButton("click me");
frame.getContentPane().setLayout(new java.awt.FlowLayout());
frame.getContentPane().add(btn);
frame.setVisible(true);
Thread.sleep(2000);
The code above is pretty straightforward and except for the two lines, the rest are what a developer would ideally write in a simple java program. For details on the jrunscript syntax, refer to the above blog as suggested.
Save the above code into a file (say test.js) and run jrunscript test.js
Create listeners (interfaces) containing single method only
One way is to define a simple javascript function and pass it to the actionListener as below:
btn = new JButton("click me");
function action(e)
{
System.out.println("button clicked..." + e.getID());
}
btn.addActionListener(action);
The argument e here maps to java.awt.event.ActionEvent class.
Second way is to define the exact method name as defined in ActionListener interface in java.awt.event package and create a JavaScript object out of it
btn = new JButton("click me");
listener1 = {
actionPerformed: function (e)
{
System.out.println("ActionPerformed: button clicked..." + e.getID());
}
}
alistener = new ActionListener(listener1);
btn.addActionListener(alistener);
Note above that alistener is the ActionListener object created using listener1 javascript object.
Create listeners(interfaces) containing multiple methods:
Consider another simple example where I would want to trap key events (keypressed, keytyped, keyreleased) in an editable field (JTextField for instance). java.awt.event.KeyListener interface has multiple methods declared inside it.
This is how one could implement it
listener2 = {
keyPressed: function(e)
{
System.out.println("key Pressed..." + e.getID());
},
keyReleased: function(e)
{
System.out.println("key Released..." + e.getID());
},
keyTyped: function(e)
{
System.out.println("key Typed..." + e.getID());
}
}
keylistener = new KeyListener(listener2);
tf = new JTextField("Type here");
tf.addKeyListener(keylistener);
Note above that function definitions are separated by commas inside the listener2 javascript object block.
A simple animation using JDialog:
parent = new JFrame();
dlg = new JDialog(parent, "JDialog(Modaless)", false);
label = new JLabel("This is a cool demo using jrunscript tool...");
dlg.getContentPane().add(label);
x=400;
dlg.setLocation(x, 200);
dlg.setVisible(true);
var size = dlg.getWidth();
expand = true; //expand dialog
while (true) {
if (expand && size < 400) {
dlg.setLocation(x, 200);
dlg.setSize(size, 50);
size = size + 6;
x = x - 3;
Thread.sleep(20);
continue;
}
expand= false; //shrink dialog
if (size > 0) {
dlg.setLocation(x, 200);
dlg.setSize(size, 50);
size = size - 6;
x = x + 3;
Thread.sleep(20);
continue;
}
expand = true;
}
The code above when run would expand and shrink a dialog with a time delay of 20ms. The exact degree of smoothness may depend on the system's configuration but the above code should give you an idea of what is being tried out here.
A multitask application combining all the above code along with another JList where items are selected by rotation
Here is the complete runnable code;
importPackage(javax.swing);
importPackage(java.lang);
importPackage(java.awt.event);
frame = new JFrame("JFrame");
frame.setSize(400, 400);
btn = new JButton("click me");
function action(e)
{
System.out.println("button clicked..." + e.getID());
}
listener1 = {
actionPerformed: function (e)
{
System.out.println("ActionPerformed: button clicked..." + e.getID());
}
}
alistener = new ActionListener(listener1);
btn.addActionListener(alistener);
listener2 = {
keyPressed: function(e)
{
System.out.println("key Pressed..." + e.getID());
},
keyReleased: function(e)
{
System.out.println("key Released..." + e.getID());
},
keyTyped: function(e)
{
System.out.println("key Typed..." + e.getID());
}
}
keylistener = new KeyListener(listener2);
tf = new JTextField("Type here");
tf.addKeyListener(keylistener);
frame.getContentPane().setLayout(new java.awt.FlowLayout());
frame.getContentPane().add(tf);
frame.getContentPane().add(btn);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
frame1 = new JFrame("JList...");
strs = java.lang.reflect.Array.newInstance(java.lang.String, 5);
strs[0] = "First";
strs[1] = "Second";
strs[2] = "Third";
strs[3] = "Fourth";
strs[4] = "Fifth";
list = new JList(strs);
frame1.getContentPane().add(list);
frame1.setLocation(500, 0);
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame1.setSize(400, 400);
frame1.setVisible(true);
runit = {
run: function() {
index = 0;
while (true) {
if (index > 4) index = 0;
list.setSelectedIndex(index);
index++;
Thread.sleep(200);
}
}
}
t = new Thread(Runnable(runit));
t.start();
parent = new JFrame();
dlg = new JDialog(parent, "JDialog(Modaless)", false);
label = new JLabel("This is a cool demo using jrunscript tool...");
dlg.getContentPane().add(label);
x=400;
dlg.setLocation(x, 200);
dlg.setVisible(true);
var size = dlg.getWidth();
expand = true; //expand dialog
while (true) {
if (expand && size < 400) {
dlg.setLocation(x, 200);
dlg.setSize(size, 50);
size = size + 6;
x = x - 3;
Thread.sleep(20);
continue;
}
expand= false; //shrink dialog
if (size > 0) {
dlg.setLocation(x, 200);
dlg.setSize(size, 50);
size = size - 6;
x = x + 3;
Thread.sleep(20);
continue;
}
expand = true;
}
Thread.sleep(2000);
Hopefully the above code should run fine for everyone :-)
This should perhaps help GUI beginners to get started writing simple GUI programs and gradually continue playing with the powerful APIs offered by java GUI.
Any questions or comments are most welcome
Thanks,
Kannan
Posted at 11:41PM Mar 04, 2007 by Kannan Balasubramanian in Sun | Comments[1]
Windows tricks
Introduction:
I know there are tonnes of articles out there on the web where several tips and tricks on different windows flavors are provided.
I am listing out a few of the tricks/shortcuts that I use more commonly and some that I found out by myself by playing with the keyboards and registry. I mostly work on Win2K and WinXP and hence the tricks below are applicable to NT based systems unless otherwise specified.
1. Autotab feature
Most of the new windows oses(WinXP, Windows Vista..) have the autotabbing feature on the command prompt window. Some people may not know that these are available on Win2K and WinNT also. It's just that they are disabled by default and here is how you enable it.
Open regedit.exe
Look for the entry HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Modify the value of key "Completion Char" to 9
Restart command prompt and the autotab key is there for you.
2. Launching programs on startup
One common way that users follow is adding the program name in the Programs\Startup menu.
There are situations where you wouldn't want your program to appear on the startup menu but still be launched on startup. Here is what you do then:
Open regedit.exe
Look for the entry
HKEY_CURRENT_USER\Software\Microsoft\CurrentVersion\Run
Add key-value pairs for each program that you want to launch on startup.
For e.g. notepad "c:\winnt\system32\notepad.exe"
The keyname could be anything of your choice. The value is an absolute path to the application's location.
3. How to bypass windows login screen on startup
Open regedit.exe
Look for the entry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Now add (if they don't exist already) the below keys into this entry.
DefaultUserName <userid>
DefaultPassword <passwd>
DefaultDomainName <domain>
AutoAdminLogon 1 (i.e. Set its value to “1”)
4. Bginfo for keeping system uptodate
A nice tool from sysinternals.com. This is a tool which when installed, attaches itself as a wallpaper to the desktop. The tool displays relevant information about your computer (like hostname, ipaddress, memory size ...). It updates the computer information everytime you boot the system and is always uptodate.
http://www.sysinternals.com/utilities/bginfo.html
5. Shortcuts
This is for systems with windows key which is found in all the keyboards in the present days.
Assuming I represent windows key as "#" just for simplicity, here are the applications I launch easily with the windows key + a character key combination (i.e. both pressed together).
# and e -> opens windows explorer
# and f -> opens search for files and folders window
# and r -> opens run command box
# and u -> opens utility manager
# and d -> minimizes all visible windows on the screen
6. Stopping CDs from Auto Running
Most of the CDs (like video, movies, audio ...) startup automatically as soon as the CD is inserted into the drive on NT based systems. There are times where I do find this irritating. I know I am really picky sometimes.
To prevent this, do this
press and hold on shift key when the CD is inserted and until it stops spinning. This will prevent the autorunning of CD.
7. Increasing/Decreasing font size on browsers (IE, Mozilla FireFox, ...)
The general way is to use the View->Text Size menu option in either of IE/Mozilla to increase or decrease the text size of the currently viewed page.
Easier way (that I use all the time) is hold down ctrl key + scroll mouse wheel upwards or downwards for decreasing/increasing font size respectively.
8. Move window to fullscreen mode
This may not be applicable to all windows applications. For commonly used applications that provide fullscreen feature in their menus, there is another easiery way of entering into full screen mode
ctrl + double click on the title bar
or just press F11 key
That's it for all I could remember at this point. Will keep updating it as and when I remember any more tricks that I normally use.
Kannan Balasubramanian
Posted at 11:20PM Aug 10, 2006 by Kannan Balasubramanian in Sun | Comments[0]
Some Basic Desktop configurations
How to run Java in the same color bit depth as the console:
How to change the default color depth:
Change the default printer temporarily
Some useful commands on Solaris:
Resolution change
Useful commands related to printer on Linux
Create a snapshot of any image/window
Some
useful commands on Windows
Objective: This document aims at
- pointing out the different environment setups, flags needed to run 2D testsuites on various platforms
- getting familiarised with the different commands and setups on different os.
- troubleshooting the different problems that may arise during test execution.
The
information given here may not be common to all the Sparc Solaris (2.6,
2.7, 8, 9) machines, but a majority of them should work.
Some of the commonly
used framebuffers and the command for each on Sparc Solaris are as below:
| Framebuffers(Graphics card) | Command |
|---|---|
| ffb (Creator3D ) | ffbconfig |
| afb (Elite3D) | afbconfig |
| ifb (Expert3D) | ifbconfig |
| m64 (PGX8, PGX24) | m64config |
| GFX(PGX 32) | GFXconfig |
More details about graphics card:
To get an idea of
what framebuffers are available in your machine, type 'ls -l /dev/fbs'
and you can guess on the framebuffers by looking at the list available.
For e.g. on my machine, the above command gave the following output:
- afb0-> ../../devices/SUNW,afb~1e,0:afb0
- m640-> ../../devices/pci@1f,0/pci@1,1/SUNW,m64B@2:m640
Resolution:To get the current resolution and the set of supported resolutions, type <command name> -prconf.
For e.g. if the machine has a 'afb' framebuffer, type 'afbconfig -prconf'.
Resolution change: To change the resolution do the following:
e.g. m64config -res 1152*900*76 now -depth 24 (assuming PGX24 is the framebuffer, I have)
The syntax would be similar for most of the framebuffers.
Color
depth: To
get the current color depth, type 'xwininfo' at the command prompt. The
cursor waits for the user to click the mouse on the window whose color
depth he/she needs to know. Click on the window and the tool dumps out
a lot of information including the color depth.
FYI: /usr/openwin/bin/xdpyinfo could also be used for displaying the color depth of the current window.Color depth change: This is an interesting feature for Java applications running on Sparc Solaris.Note: On Solaris unlike windows, different windows could be running on different color bit depth.
Important: Java always tries to run applications in the best color depth(not resolution) possible on Solaris.
So if my machine supports 8, 16, 24 bit color depths and the console from where the Java app is launched is in 8 bit, the application would still be running on 24 bit color depth. You can verify this by using the xwininfo command (as mentioned above).
How to run Java in the same color bit depth as the console:
set the environment variable FORCEDEFVIS and launch the Java application.
How to change the default color depth:
modify /etc/dt/config/Xservers file by changing the value of 'defdepth' parameter and restart X server.
On the desktop, you would generally find the 'Personal Printers' menu which has normally 3 printer related options
- Default -> shows the default printer where all printjobs will be redirected to, if printed without selecting any printer from the print dialog.
- Printer Selector -> invokes a 'Printer Selector tool' dialog displaying a list of all the printers on the network. The user can select any printer from the 'All Printers' list, add it to the 'Selected Printers' and change the default one by clicking on the 'Change Default' button. Click on 'Save Changes' button and restart Xserver to get the changes into effect.
- Print Manager -> shows the status of each print job on all the connected printers. The user has the option to cancel a print job in the queue using 'Print Manager' tool.
- Default -> /usr/dt/bin/dtprintinfo
- Printer Selector -> /usr/dist/share/cue,v2.1.6/tools/std/printer_selector
- Print Manager -> /usr/dt/bin/dtprintinfo -all
- setenv LPDEST <printer name> (assuming cshell here)
- Launch your application
The
information given here may not be common to all the different flavors of
Linux (RedHat, Suse, Caldera, Mandrake, Turbo...) but a majority of them
should work. Commands specific to certain Linux flavors have been specified
wherever possible.
find the runlevel
of your machine (usually it's 5 on most Linux machines with X11 running)
ntsysv
displays all the services and the status of each (on/off).
Runlevel determines the mode on which the machine has been booted and is currently running. To determine the runlevel of your machine, foll the steps below:
- open /etc/inittab file.
- Look for the entry 'initdefault:'
- The format would be like 'id:<number>:initdefault:
- The value of <number> is the runlevel of your machine.
| Runlevel | Mode |
|---|---|
| 0 | Halt |
| 1 | Single user |
| 2 | Multi user (without NFS) |
| 3 | Multi user (with NFS) |
| 4 | unused |
| 5 | X11 |
| 6 | reboot |
To determine the graphics card on Linux (RedHat), follow the steps:
- cd /etc/X11
- open XF86Config (XF86Config-4 on RedHat 7.0 and higher) and search for 'Section Screen'
- The 'Device' subentry contains the video card name.
To determine the current resolution on Linux (RedHat), follow the steps:
- cd /etc/X11
- open XF86Config (XF86Config-4 on RedHat 7.0 and higher) and search for 'Section Screen'
- The 'Modes' subentry under 'Display' subsection represents the resolution.
To determine the current resolution on Linux (RedHat), follow the steps:
- cd /etc/X11
- open XF86Config (XF86Config-4 on RedHat 7.0 and higher) and search for 'Section Screen'
- The 'Depth' subentry under 'Display' subsection represents the color depth.
There are different tools for setting up printer on different linux versions.
Some
commands that I know of:
| Linux version | Command |
|---|---|
| RedHat Linux (any version) | printtool |
| Turbo Linux | turboprintcfg |
| Caldera Linux | kups(GUI) or cupsd(command line) |
| Mandrake Linux | /usr/bin/printtool or /usr/sbin/printerdrake |
| SuSE Linux |
/sbin/yast
(for configuring anything not only printer)
|
Trick: Generally (but not on all linux machines), you would find the printer command for adding/editing/deleting a printer from the /etc/printcap file.
e.g. for RH Linux (7.0 & higher)
- type 'printtool' at the console.
- Click on 'New' icon. It brings up a 'Edit Queue' dialog.
- Type any name under 'Name and Aliases'->'Queue Name'
- Enter printer server name under 'Queue Type'->'Server'
- Enter printer name under 'Queue Type'->'Queue'
- Select the appropriate driver under 'Printer Driver' category
- Click on 'ok'. This goes back to the first dialog.
- Save the changes by selecting 'File'->'Save Changes'.
- Restart the lpd with 'File'->'Restart lpd'
- Test the printer by selecting any of the option from 'Test' menu.
- If the printer works, you are all set to use the printer.
Restart lpd from command line:
To manually restart lpd from command line, do the foll:
lpq gives status of all the printjobs.
/net/sqesvr/deployment2/kannan/tools/linuxver
Some useful commands on Linux:
Note: The commands below may not be applicable on all the different flavors of Linux .
ifconfig -a -> displays the ip address
The best way to know all the hardware details about your PC is by using 'belarc' software.
Go to http://www.belarc.com and download the 'belarc advisor'. The installer after installation would show all the details about your PC.
On most of the Windows platform, the common way to find out the graphics card is as follows:
- Right click on the desktop.
- Click properties and the 'display properties' dialog pops up.
- Select the Settings tab.
- you should be able to find the graphics card name below the Display label.
- Open command prompt
- Type 'debug' and press <ENTER> key.
- At the '-' prompt, type 'd c000:0'
- You would possibly see the graphics card name on the right. If it still doesn't appear, type 'd' once or twice and the name should certainly appear.
To get the current resolution and all possible resolution follow the steps 1-3 in 'Method 1' of Graphics card section.
Find
the value of the current resolution in the 'Screen Area' label. Click/drag
the slider to change the resolution.
To get the current color depth and all possible color depths follow the steps 1-3 in 'Method 1' of Graphics card section.
Find the value of the current color depth in the 'Colors' drop down box. Select a different color depth to change its value.
To select a different driver (other than the existing for a connected printer):
- Right click on the printer(whose driver needs to be changed) icon.
- Select 'properties' option.
- Install a new printer driver from 'Advanced'->'New Driver' button.
- select the printer icon (which has to be made the default).
- Right click on the icon
- Click on 'Set as Default Printer'
- The selected printer becomes the default printer.
Create
a snapshot of any image/window:
- Select the window you want to take snapshot of.
- Press Alt-PrintScreen key combination on the keyboard. The image gets copied on to the clipboard.
- Open any image viewer (like paintbrush or PaintShopPro) and do a paste(Ctrl-v). The image could then be saved in any format supported the viewer.
Some
useful commands on Windows:
ipconfig /all -> displays the ip address on command line.
Kannan Balasubramanian
Posted at 11:25PM Aug 09, 2006 by Kannan Balasubramanian in Sun | Comments[1]