java

What tools do you recommend to someone who wants to learn Java in a short time?

Greetings! I’m a .Net developer (VB.Net, C#) with 5 years experience. I would like to learn the Java programming language. What tools do you recommend for a programmer who wants to learn to program in Java SE? I’m specifically interested in books, tutorials and tools that would enable an existing programmer to learn Java in a short time....

Java PriorityQueue removal of arbitrary elements performance

Say I have a java PriorityQueue (which java implements as a heap) that I iterate over to remove elements based on some criteria: PriorityQueue q = new PriorityQueue(); ... Iterator it = q.iterator(); while(it.hasNext()){ if( someCriterion(it.next()) ) it.remove(); } How long does each remove() operation take? I'm not sure ...

Best way to profile memory usage in a Java application?

I realize that similar questions have been asked about this before here on SO, but let me describe exactly what I need to do: I have a set of tests which run a command line java application and I'd like to add memory profiling to them. One option I see would be to add code (possibly using 3rd party tools/libraries) to my application th...

.PRN file generation

Hi, I want to generate a .prn file using Java. Is there any java api already available ? Is there any value in generating a .PRN file now-a-days (Mine is a web based application trying to mimic the existing client/ server application functionality. The current fat client application is pretty old). If there is no API available whats t...

Events For Window Dragging in Java

I'm trying to implement an OS X drawer like feature in Java, and so I'm going to have one window hiding under another. However when I drag the primary window (JFrame) I need to send updates as it moves to the secondary window (JWindow) below. So it'd be something like this… --------------- | |---------- | JFrame | ...

Streams in java

hello everyone well, i am developing a single server multiple-client program in java. My problem is can i use single stream for all the clients or do i have to create a seperate stream for each client? please help thank you ...

Usage of ICEFaces push technology

We are looking at/investigating the possible usage of ICEFaces AJAX push technology. Wondering if anyone has used this? What issues they faced? And overall impression of it. We are using Websphere 6.1 application server - has any one who has implemented this implemented it on Websphere. We are trying to address an issue on our site i...

Programatically calculate memory occupied by a Java Object including objects it references

I need to programmatically find out exactly how much memory a given Java Object is occupying including the memory occupied by the objects that it is referencing. I can generate a memory heap dump and analyse the results using a tool. However it takes a considerable amount of time to generate a heap dump and for such a tool to read the ...

Java Graphics cannot change Font

Hello, I am trying to do a custom painting using the Graphics object. I want to paint the text in word-wrap style, so i used some example code i found somewhere on this page. My problem is that i cannot change the font-size in any way. Please help me, I attached the executable source code below. Thanks Chris import java.awt.Color; i...

Reloading a JTree during runtime

I create a JTree and model for it out in a class separate to the GUI class. The data for the JTree is extracted from a file. Now in the GUI class the user can add files from the file system to an AWT list. After the user clicks on a file in the list I want the JTree to update. The variable name for the JTree is schemaTree. I have the f...

How to determine tomorrow's date in J2ME for use in a DateField?

I basically want to be able to show tomorrows date I have this which shows today date private Date date = new Date(); i tried this but this gave me jan 1 1970 private Date date = new Date(+1); please help ...

Suggestions for Stress Testing BlazeDS

We are removing our XSL-> HTML solution annd replacing it with a Flex UI for our userbase. One of the concerns is that the BlazeDS (amf endpoint, so streaming or polling) won't be able to handle the load as well as the EJB -> XML -> XSLT -> HTML stack. My theory is that it should perform better, but I need a way to statistically prove th...

What language / platform would you use for a shareware / freeware desktop application?

I have a DVD cataloging application that I wrote a few years ago with MFC. Records are saved in a sqlite database, so basically it's a CRUD app. UI-wise, it has a tree view on the left, a list view (grid) on the top right, and an HTML view (embedded IE) on the bottom right. Nothing fancy. I wanted to update the app with more features, b...

How do you set the tab size in a JEditorPane?

A JTextArea's tab size can easily be set using setTabSize(int). Is there a similar way to do it with a JEditorPane? Right now, text with tabs in my pane looks like: if (stuff){ more stuff; } And, I'd prefer a much smaller tab stop: if (stuff){ more stuff; } ...

JPanel Margin in BoxLayout

For custom rendering purposes, I've created a class (axialPanel.java) that extends JPanel and overrides the paintComponent method. An instance of axialpanel is added to the west side of a container class set with a BorderLayout. I would like to have a few pixels of margin around the axialpanel, but setting axialpanel's border to an insta...

Hibernate polymorphism: instantiating the right class

I'm new to hibernate, as you'll soon see. I apologize if this question has an easy answer, but I'm just not familiar enough with all of the terminology to find it easily. Let's say I have a base class "A" and one subclass "B" that I'm mapping with Hibernate, perhaps using the table per subclass strategy. The base class is not abstract...

QuickTime for Java vs. iTunes DRM

The Apple QuickTime standalone player can manage iTunes' DRM scheme well enough to play movies downloaded from iTunes with no problem. Is there any way to get QuickTime for Java to handle iTunes DRM similarly well, or is that simply beyond the software's abilities? ...

java.util.ConcurrentModificationException in JasperReports

We have a web application deployed to Websphere 6.1.0.19 on Windows. We occasionally see this ConcurrentModificationException on a few of our reports. We are using JasperReports 2.0.5 in production. The full stacktrace is following: java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(...

BlazeDS and ArrayList of custom objects

I'm using BlazeDS to connect Flex with Java. I'm having trouble passing ArrayLists of custom objects from Flex to java. I have two objects, one is called Category, the other Section. A Category has an ArrayList of Section objects. I can send an ArrayList of Category objects back and forth between Flex and Java, the problem is when ...

How to be able to extract comments from inside a function in doxygen?

I'm interested to know if it is possible to have some comments in a function (c, c++, java) in a way that doxygen could put them in the generated html file. for example: function(...) { do_1(); /** * Call do_2 function for doing specific stuff. */ do_2(); } ...