Karthikeyan Chandrasekaran

Greenhorn
+ Follow
since Feb 10, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Karthikeyan Chandrasekaran

Hi All,

JTable provides in-built support for reordering columns(by clicking on column header and dragging it to desired location). I would like to create a similar behavior in JTable rows. That is, I should be able to select and drag a row to a particular position. Could anyone tell me how to do that?
16 years ago
I have passed an array of flavors to lookupMultiDocPrintServices() method, but the array contains only one element.(Please look at my code). So the result should be same for lookupMultiDocPrintServices() and lookupPrintServices(). But still lookupMultiDocPrintServices() returns empty.
16 years ago
Hi All,

I have just tried the following code and the results are different. Can anyone tell why this happens?

import javax.print.*;

public class Printer {


public static void main(String[] args) {

DocFlavor[] flavors = {DocFlavor.SERVICE_FORMATTED.PRINTABLE};

PrintService[] pServices =
PrintServiceLookup.lookupPrintServices(flavors[0], null);


System.out.println("===PrintService===");

for(int i=0; i< pServices.length; i++) {

System.out.println(pServices.getName());

}

pServices = PrintServiceLookup.lookupMultiDocPrintServices(flavors, null);


System.out.println("===MultiDoc PrintService===");

for(int i=0; i< pServices.length; i++) {

System.out.println(pServices.getName());
}

}

}


Here lookupPrintServices() method returns all the printers installed in my machine, but lookupMultiDocPrintServices() returns empty.

I am using Java 5 in Windows 2000.
16 years ago
I am facing with a strange problem in JMenu.... I have a Swing application in which various menus are available. On selecting each menu item, different screens will be loaded.(through actionlistener). But when I try to select a particular menu item repeatedly, sometimes menu item which is ahed of currently selected menu item gets triggered and corrosponding screen gets loaded. So when I select a menu item, screen for adjacent menu item gets loaded. But this doen not happen frequently.

Note: different screens are loaded for each menu item in actionlistener code which is in Even Dispatcher Thread.

I was not facing the issue when I used JDK 1.4. Now I am using Java 5 and this issue happends without any code changes.

Please let me know how to solve the issue.
17 years ago
Create a custom cell editor and use JPasswordField as editing component
[ January 04, 2007: Message edited by: Karthikeyan Chandrasekaran ]
17 years ago
Hi,

I am using a JScrollPane to scroll the contents of a JTable vertically. Whenever I drag the thumb of scrollbar, last column in table got distorted. All other columns remain perfect.

I have changed viewport scrolling mode to JViewport.BACKINGSTORE_SCROLL_MODE. Now last column is scrolled perfectly without any distortion but performance of scrolling got degraded.

Please let me know how to solve the issue.

Note: I am using custom renderers for table and running my code with JRE 1.4.2.
17 years ago
I have a component listener for a dialog(JDialog) and when the JDialog is closed by a call to dispose() method, ComponentHidden event is not triggered. But if I use hide() method to close the dialog, then ComponentHidden event is fired properly. Is this a bug or is this the way it was designed?
17 years ago
Hi,

We can get list of avaialble print services and their names. But how to get Port name of a printer?

Note: I am using JDK1.4.2 with Windows 2000
17 years ago
Could you let me know how to create a detached(from parent) independant process from java?
17 years ago
I have a Java Swing application which is started by a batch(.bat) file. The batch file is in turn started by a utility written in C++ as a seperate process using WIN32 API.

In my java application I am getting screen captured using createScreenCapture() method of java.awt.Robot class.

When I manually start the batch file, i am getting screen shots correctly. But if I use the utility written in C++ to start my application,
i am getting a black rectangle instead of actual screen shot. Please let me know how to solve this issue? Also let me know if there is any way to capture screen other than using java.awt.Robot class.
17 years ago
Hi All,

I have a swing GUI from which i am calling a batch file using RunTime.exec() . That batch file will kill and restart the GUI. But when it kills the GUI it itself got killed. So GUI is not coming up. Please let me know how to overcome this issue?
17 years ago
Hi all,

I have a Windows batch file(.bat) which launches my GUI(Swing) application. I want to make sure only one copy of my application should be running at any time.
For example, assume that I have launched my application by running the batch file. Now if i try to execute the batch file it should not launch application and it should say something like "Application already running".

Please let me know how to achieve this.

Karthikeyan
17 years ago
Thanks for your reply. But this is what i have already done. It works well when the dialog gets displayed. In the dialog, i will click some buttons or i will type something in a textbox available. Now the keyboard focus will be on some componenet other than default button. In this situation if i hit enter key, the button which is having keyboard focus gets triggered. But i want my desired button to be triggered eventhough keyboard focus is available with some other button.

Can you give me a solution to my requirement?
[ June 01, 2006: Message edited by: Karthikeyan Chandrasekaran ]
17 years ago
Hi all,

I am having one dialog in my application which is having few buttons. I want to set one button as default button so that when the dialog is active, hitting enter key should result in action triggerd for a specific button in the dialog even if the button doesnot have keyboard focus.
I tried with following code in my dialog:

this.getRootPane().setDefaultButton(buttonObj);

But i havent got what i expected. On hitting enter key, the button which has keyboard focus triggers event not the default button i set.

Can anyone help me to get my desired bahaviour?
Note: I am using default java look and feel.
17 years ago
Hi all,

As per my understanding, we may need to develope a minimal version of database in Java and we have to use it for the assignment part of the exam. So i want to know what are the ways through which a simple database can be created. So far i have the following 2 ideas.

1. Using ObjectOutputSteram and ObjectInputStream to perform write/read operations with a persistant storage.

2. Using RandomAccessFile class to perform read/write operations into a file there by providing a simple database.

Let me know whether there is any better alternates/ refined ways to accomplish this task.