java

SWT TrayItem Mouse listener

Hello! I use SWT for my app and all significance of it, to use system tray. May be some one know how to add mouse listener to the TrayItem (or just handle mouse events)? For example, handle mouse hover event. Thanks in advance and best regards, Alex ...

How can I list all deployed jax-ws webservices?

I have deployed some jax-ws webservices in a tomcat: web.xml: ... <servlet> <servlet-name>WebServiceJaxWs</servlet-name> <servlet-class>...a bean of mine which overwrites WSServletDelegate</servlet-class> <load-on-startup>1</load-on-startup> </servlet> ... The webservices themselves are defined in the sun-j...

NSIS - How to run Java Application In NSIS?

I wanna run a java application through NSIS. My java program is called PropertiesReader.java which reads a property from a .config file.How can I do this? Also the output of java program (which in this case is the property value) is stored in some variable say property_value in java program. How can i access back the value of this variab...

Display rest of rows as "other" with JfreeChart

I'm working with JFreeChart and would like to create a Pie Chart that shows the first 10 records on the chart and the remainder of the records combined under "Other". Is there an approach to do this? ...

how to set up environment for web dynpro?

Is there a way I can learn on Web Dynpro without having to set up an SAP environment? There was an opening for a job requiring Web Dynpro skills and it was mentioned alongside with other Java skills. I wanted to apply but have no clue on web dynpro, and so wanted to set up an environment to understand what it is all about. Can someone t...

Best way to plug memory holes in J2EE struts app (without paying money :( )

I have a J2EE struts app running on Weblogic 10.3 which has obviously severe memory issues. My company won't buy 3rd party tools like Jprobe so my only option is to use freely available tools. I have enabled gc logs and observed that memory consumption is unusually high triggering frequent gc cycles. Right now I am configuring JAM consol...

Java Swing: Generating dynamic GUI forms from XML

Hi, I am writing this application in Java, where I have a JTree on the left of the JFrame, and the item selected in the JTree determines what appears on the right. This is similar to Edit --> Preferences in Thunderbird, and several other applications' preferences. Anyhow the main difference is that in my app the stuff on the right is d...

do this without using an "if" | if(s == "value1"){...} else if(s == "value2") { ...}

according to anti-if campaign it is a best practice not to use ifs in our code. Can anyone tell me if it possible to get rid of the if in this piece of code ? (switch is also not an option, The point is to remove the conditional logic, not replace ifs with similar language constructs) if(s == "foo") { Writeln("some logic here"); }...

Why do we need to specify class inside <persistence-unit> element?

My persistence.xml has 2 persistence-units. Each of them has several <class> elements. I thought that we must specify all classes related to certain persistence-unit. But I accidentally forgot to specify class-element for new entity but the program worked fine even without it. Then I removed all class-elements and everything worked fine...

google java api for google search

Does google provide a Java server side api *(NOT java script).*I dont want the ajax api which works at clint side. What i want is that the result returned for a keyword should return me search result in some specific data structure.Like List or set data structure.Then i want to manipulate the result according to my need in java code. I...

How to save data entered in textfields onto a database?

For example: Name: 'textfield1' Surname: 'textfield2' Age: 'textfield3' Save those three textfields and make a file where it would print it like this: textfield1, textfield2, textfield3 ...

How to make a folder hidden using java

Hi, I want to create a hidden folder using java application. That program should work across platform. So How to write a program which can create hidden folder. I have tried using File newFile = new File("myfile"); newFile.mkdir(); It creates a directory which is not hidden. ...

Passing data from one page to other on click of a hyperlink

Hi All, I have a link, on click of which I have to got the next page, I'm giving the url for the link as http://localhost/test/controller?name=""&amp;image="url" Is there a way to pass the data without appending to the url on click of a link?Its normal a href. ...

Can I store the JNI Java Env variable?

Hi, I'm making a lib so that cpp apps can communicate with the JVM. Suppose that the JVM has already started how can I make a cpp binary communicate with the JVM? I think the best solution is to store the JNI env variable in the shared object (so) so I can include it on the cpp and use later. Is that possible? EDIT ---- I want to get ...

How can I run JavaScript code at server side Java code?

I want to run JavaScript code at the server side. I want to manipulate result returned by JavaScript inside my Java code. How can it be done? ...

creating an installer for a java spring mvc app

any good tutorials on creating an installer that will install a spring mvc web application, namely setting up tomcat and postgresql on someones desktop? ...

media conversion library

I am building a mobile website were users can upload/download videos and am looking for a library that can convert the media files from mpeg, 3gp, mov depending on what the user wants to download. thanks in advance. ...

Access a new frames methods

This method shows a new window in my application: public void ShowNewCustomerView() { if (NewCustomer == null) NewCustomer = new NewCustomerView(this); NewCustomer.setVisible(true); } The class NewCustomerView has this method: public void ClearFields() { txtAddress.setText(""); txtCity.setText(""); txtCompanyName....

Java Updating Small Circles

I need to display a large number (500+) of small circles on a form to simulate LEDs. However, these circles need to be quite small, around 8 or 9 pixels diameter. So far, in my testing, I've put together some code that creates an Led class that uses a Shape (Ellipse2D.Double) and displays it directly on the JFrame from the JFrame's pain...

The constructor Date(...) is deprecated. What does it mean? (Java)

I'm trying to create a Date like this: date = new Date(year-1900,mon-1,day,hrs,min,sec); and Eclips gives me this warning: "The constructor Date(int,int,int,int,int) is deprecated". What does it mean for a constructor to be deprecated? What can I do? ...