This week's giveaway is in the Spring forum.
We're giving away four copies of Microservices Testing (Live Project) and have Chris Love & Andres Sacco on-line!
See this thread for details.
Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

vaibhav agarwal

Greenhorn
+ Follow
since May 06, 2005
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 vaibhav agarwal

Hi,

I have to listen CTRL key event on panel... can any one send sample code......

Thanks
Vaibhav
17 years ago
Hi,

yes whats d way... i could not get exectly what u r saying .......
17 years ago
Hi,

I have a page�.. I have divided that page into 48 block.. by drawing vertical and horizontal lines � that is blocks are not independent component � my requirement is that when I click on the block � that block should get highlighted or change its color � or darken its border � how to achieve this functionality �

Regards
Vaibhav Gupta
17 years ago
Hi,
I have to save our data in XML format I am getting data but unable to save it something is going wrong..

Problem in following code

JNLPProxy.saveAsLocalFile(bio, "export.xml");




where bio is ByteArrayInputStream which containing data..
and JNLPProxy class is


public final class JNLPProxy
{

private static final Object basicServiceObject = getBasicServiceObject();
private static final Class basicServiceClass = getBasicServiceClass();
private static final Object fileOpenServiceObject = getFileOpenServiceObject();
private static final Class fileOpenServiceClass = getFileOpenServiceClass();
private static final Object fileSaveServiceObject = getFileSaveServiceObject();
private static final Class fileSaveServiceClass = getFileSaveServiceClass();

public static void main(String[] args) throws Exception{
showDocument(new URL(args[0]));
}

public static boolean showDocument(URL url){
if (basicServiceObject == null) {
return false;
}

try {
Method method = basicServiceClass.getMethod("showDocument",
new Class[] { URL.class });
Boolean resultBoolean = (Boolean) method.invoke(basicServiceObject,
new Object[] { url });
return resultBoolean.booleanValue();

} catch (Exception ex) {
ex.printStackTrace();

throw new RuntimeException(ex.getMessage());
}
}

public static URL getCodeBase(){
if (basicServiceObject == null) {
return null;
}

try {
Method method = basicServiceClass.getMethod("getCodeBase", null);
URL url = (URL) method.invoke(basicServiceObject, null);
return url;

} catch (Exception ex) {
ex.printStackTrace();

throw new RuntimeException(ex.getMessage());
}
}


private static Object getBasicServiceObject() {
try {
/*Class serviceManagerClass = Class
.forName("javax.jnlp.ServiceManager"); *///here change required @Vaibhav

Class serviceManagerClass = Class.forName("javax.jnlp.ServiceManagerStub");
Method lookupMethod = serviceManagerClass.getMethod("lookup",
new Class[] { String.class });

return lookupMethod.invoke(null,
new Object[] { "javax.jnlp.BasicService" });
} catch (Exception ex) {
return null;
}
}

private static Class getBasicServiceClass() {
try {
return Class.forName("javax.jnlp.BasicService");
} catch (Exception ex) {
return null;
}
}
private static Object getFileOpenServiceObject() {
try {
Class serviceManagerClass = Class
.forName("javax.jnlp.ServiceManager");

Method lookupMethod = serviceManagerClass.getMethod("lookup",
new Class[] { String.class });

return lookupMethod.invoke(null,
new Object[] { "javax.jnlp.FileOpenService" });
} catch (Exception ex) {
return null;
}
}

private static Class getFileOpenServiceClass() {
try {
return Class.forName("javax.jnlp.FileOpenService");
} catch (Exception ex) {
return null;
}
}
private static Object getFileSaveServiceObject() {
try {
Class serviceManagerClass = Class.forName("javax.jnlp.ServiceManager");

Method lookupMethod = serviceManagerClass.getMethod("lookup",
new Class[] { String.class });

return lookupMethod.invoke(null,
new Object[] { "javax.jnlp.FileSaveService" });
} catch (Exception ex) {
return null;
}
}

private static Class getFileSaveServiceClass() {
try {
return Class.forName("javax.jnlp.FileSaveService");
} catch (Exception ex) {
return null;
}
}

public static boolean saveAsLocalFile(InputStream is, String fileName) {
if (fileSaveServiceObject == null) {
return false;
}

try {
Method method = fileSaveServiceClass.getMethod("saveFileDialog",
new Class[] { String.class, String[].class, InputStream.class, String.class});
method.invoke(fileSaveServiceObject,
new Object[] {null, null, is, fileName});
return true;

} catch (Exception ex) {
ex.printStackTrace();

throw new RuntimeException(ex.getMessage());
}
}
private JNLPProxy() {
}
}



But it is not working and returning null�plz give me the appropriate advice where the problem is...

Thanks
17 years ago
Thanks for Solution...

but still i could not exect... can you please send some code.....

>You just want to open that link...

Exactly I want only it bother about how so please give me some code related to this topic

Thanks & Regards
Vaibhav
17 years ago
Hi All

I have to display HyperLink Data in Jtable column... and that HyperLink is a URL after clicking that HyperLink data should be displayed..

still i couldn't get how can i display HyperLink in JTable column....

any one having any idea regarding this problem...

Thanks & Regards

Vaibhav
17 years ago
Hi all

I make one Jtable in which data would be very in run time.. i have to find table height for this i am using table.setPreferedSize()..but it gives the static height of table... but i need actual height height which has been changed after filling data.. i wrote one renderer for change the table row height in run time according to data.. so how can i get i actual size of table after runnig the application....

thanks in advance

Vaibhav Gupta
17 years ago