priyas sakorikar

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

Recent posts by priyas sakorikar


I was getting ClassCastException JLable cannot be cast to JRadioButton.

I have done some more experiments.Please see the code below..

This code creates a JTextField where array data has null value..It creates the table without exceptions .Now when i click on JRadioButton just below JTextBox..The textbox converts to RadioButton..
12 years ago
Hi all,

i wan to make a JTable with JRadioButon such that one or two cells will not have any JRadio Button depending upon value I get from Database. When same code is run with Metal look and feel it works..but with Nimbus it does not.. If getValueAt() method returns null I get NullPointerException... I tried to change the code..(basic code i got after googling)

Please see the code:

when I run this code I get NullPointerException if return(Object)new JRadioButton("NoData"); is removed from method public Object getValueAt(int row, int col). The NullPointerException is removed by adding line return(Object)new JRadioButton("NoData"); in the code but it makes a JRadioButton in the table with lable No data..What I want is the cellshould not have any value at all..
I changed the code of public Object getValueAt(int row, int col). to

where useLessobj is an object created earlier..But it gives me ClassCastException in

public Component getTableCellRendererComponent(
JTable table, Object value,boolean isSelected, boolean hasFocus, int row, int column)
if (value==null) return null;
return (Component)value;

I tried returning a JLable from getTableCellRendererComponent method but again ClassCastException is what i get.

Please suggest correct way of doing this..

12 years ago

I am creating a swing applicaiton. I have created a Jframe with a button. when I click on this button it should display data which I retrieved from DB in a different window.
After disposing new window control should come back to main window.
Or is it possible to use anyothe component/container for new window.

Can any one help me?

12 years ago
myService1.exe is nothing but prunsrv.exe which is from Apache foundation. prunsrv.exe can be renamed if required. Tomcat.exe which we use is the same prunsrv.exe with name changed to Tomcat.

prunsrv is used to create daemon.I am trying to make my application> MyService1.class as a windows application.

You can find more information for this on Prunsrv site.
12 years ago
I have done some thing funny.. but it removed previous error/s.But now got ClassnotFoundException
this is what i have done :
I copied prunsrv.exe,prunsrvmgr.exe,msvcr71.dll jvm.dll,rt.jar,java.exe to the same folder where my application is available.Now i executed this with

MyService1.exe //IS//MyService1 --Install=MyService1.exe --Description="My Java Service" --StartMode="java" --StartClass="myService.MyService1" --StartParams="start" --StartMode="java" --Jvm="jvm.dll" --JavaHome= . Classpath= .

This is what I am getting now:
C:\Prv>Service //TS//Service
java.lang.NoClassDefFoundError: myService1/MyService1
Caused by: java.lang.ClassNotFoundException:myService1/MyService1
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
Could not find the main class: p.Service. Program will exit.
Exception in thread "main"

It is like
unable to solve this. Please ignite my mind.

12 years ago

I tried that.. but now i am not getting any output at console.

I tried to change the name of the exe again and then tried with //TS option directly like

MyService1.exe //TS//MyService1 --Install=MyService1.exe --Description="My Java Service" --Classpath=" C:\Documents and Settings\Prv" --StartMode=java --StartClass=myService1.MyService1 --StartParams=start --StdOutput=auto --StdError=auto --JavaHome="c:\Program Files\Java\jdk1.6.0_21\bin" --StartMethod=start --Jvm="C:\Program Files\Java\jre6\bin\client\jvm.dll"

I am getting following Error message along with one warning :

[2011-07-21 10:04:19] [warn] The system cannot find the Registry key for servic
e 'MyService1'
[2011-07-21 10:04:19] [error] Load configuration failed
[2011-07-21 10:04:19] [error] The system cannot find the file specified.
[2011-07-21 10:04:19] [error] Commons Daemon procrun failed with exit value: 2 (
Failed to load configuration)
[2011-07-21 10:04:19] [error] The system cannot find the file specified.

please give some solution at the earliest..
12 years ago
Hi All,
I am trying to make a windows service with java.I used Apache foundations' prunsrv.exe for the same.The code written is

I compiled this code and tried to run it at commandline with following statement:

MyService1.exe //IS//MyService1 --Install=MyService1.exe --Description="My Java Service" --Classpath= C:\Documents and Settings\Prv --StartMode=java --StartClass=myService1.MyService1 --StartParams=start --StdOutput=auto --StdError=auto --JavaHome=c:\Program Files\Java\jdk1.6.0_21\bin --StartMethod=start --Jvm=C:\Program Files\Java\jre6\bin\client\jvm.dll

I tried to start this from administrative tools -> Service But could not. On command prompt I tried MyService //TS//MyService which is used ot run service from commandline. I am gettting error:
Service 'MyService1' is missing the ImageFile

I googled it. somewhare I found that if I copy msvcr71.dll from jdk/jre/bin to system32 directory the problem will be solved. But it didnot work.
Please do help at the earliest.
12 years ago