Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [java]

Java is a high-level object-oriented programming language. Use this tag when you're having problems using or understanding the language itself. This tag is frequently used alongside other tags for libraries and/or frameworks used by Java developers.

2 votes
2 answers
3k views

How do I encode arbitrary data to XML using Java 1.4 and SAX?

We use SAX to parse XML because it does not require the entire XML document to be read into memory in order to parse a single value. I read many articles that insisted SAX can only be used to parse/...
Grant Wagner's user avatar
  • 25.8k
32 votes
12 answers
47k views

How do you read JavaDoc? [closed]

What tools/websites do you use to read JavaDocs? I currently use Firefox with 20+ tabs open when working on a J2EE project to have all the documentation available which is not very usable, is eating ...
jrudolph's user avatar
  • 8,327
8 votes
4 answers
6k views

Access USB with Java, in order to find thumbdrive manufacturer's serial#/unique-ID

Looking for a way to read the unique ID / serial# of a USB thumb drive; please note that - I am looking for the value of the manufacturer, not the one Windows allocates for it. - I need to support ...
user avatar
13 votes
5 answers
50k views

How to fix MySQL Data Truncation Error when inserting a lot of data?

I'm working with a fairly simple database, from a Java application. We're trying to insert about 200k of text at a time, using the standard JDBC mysql adapter. We intermittently get a com.mysql.jdbc....
user avatar
3 votes
6 answers
7k views

How to implement a simple auto-complete functionality?

I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface ...
Kaarel's user avatar
  • 10.6k
2 votes
2 answers
4k views

Embedded Jetty serving static content with form authentication

I try to use the Forms-Based authentication within an embedded Jetty 6.1.7 project. That's why I need to serve servlets and html (login.html) under the same context to make authentication work. I don'...
Okami's user avatar
  • 887
2 votes
4 answers
2k views

Modal dialogs in IE gets hidden behind IE if user clicks on IE pane

I have to write an applet that brings up a password dialog. The problem is that dialog is set to be always on top but when user clicks on IE window dialog gets hidden behind IE window nevertheless. ...
jb.'s user avatar
  • 23.8k
2 votes
5 answers
5k views

Join multiple XML files with xinclude tags into single file

I am creating an installer in IzPack. It is quite large, and I have broken up my XML files appropriately using <xinclude> and <xfragment> tags. Unfortunately, IzPack does not combine them ...
5 votes
5 answers
5k views

equivalent vb code for a java code

Can anyone tell me what exactly does this Java code do? SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); byte[] bytes = new byte[20]; synchronized (random) { random.nextBytes(bytes); } ...
Shoban's user avatar
  • 23k
6 votes
8 answers
12k views

Given a Date Object how do I determine the last day of its month?

I'm trying to use the following code but it's returning the wrong day of month. Calendar cal = Calendar.getInstance(); cal.setTime(sampleDay.getTime()); cal.set(Calendar.MONTH, sampleDay.get(Calendar....
Allain Lalonde's user avatar
2 votes
4 answers
3k views

How do I set the HttpOnly flag on JSF/Richfaces

I'd like to add the HttpOnly flag to JSF/richfaces cookies, especially the session cookie, to up the level of security on my web app. Any ideas?
sblundy's user avatar
  • 61.2k
-3 votes
1 answer
3k views

How to compile a java application which uses Google webdriver from comand line without ant [duplicate]

I want to compile an example code which using google`s webdriver. I saved webdriver into /home/iyo/webdriver. My code is: package com.googlecode.webdriver.example; import com.googlecode.webdriver....
user avatar
2 votes
5 answers
2k views

How can I detect from a Swing app that the PC is being shut-down?

Well behaved windows programs need to allow users to save their work when they are shutting the PC down. How can I make my app detect the shutdown event? Any solution should allow the user to abort ...
David Kerr's user avatar
0 votes
1 answer
469 views

Export ChartFX7 to SVG in Java

Can anybody give an example of exporting a ChartFX7 chart to SVG? I've tried: ByteArrayOutputStream baos = new ByteArrayOutputStream(); m_chart.setOutputWriter(new SvgWriter()); ...
user avatar
0 votes
2 answers
601 views

Java Applet crashes .NET Webbrowsercontrol

in our application we have a Java applet running inside a .NET browser control. It is a know issue from Sun that running an applet this way may crash the control. Has anyone come across the same ...
Stephan's user avatar
  • 749

15 30 50 per page