Skip to content

Tag: java

Display printer dialog

I use the following line of code to have Adobe Reader print my generated PDF: It always uses the standard printer. Is there a way to display the “choose printer” dialog instead? Answer http://download.oracle.com/javase/tutorial/2d/printing/dialog.html

Java : list that contains unique elements in order

Is there a list type in java that stores objects in ascending order and not adds if this object is previously added. I know java maps can do that but I wonder if there is a list type that does what I want. Otherwise I have to override contains, equalsTo and add methods,right? Answer So you need a list contain…

Java method to save current state of a program

Is it possible to save the current state of a java program and then reload it? The program is fairly complicated. I just need to be able to save the current state to a file and then reload it. Could you please refer me to a java library or a place to read more about that from. Answer There is

Synchronized keyword and static classes in java

I was reading a threading tutorial that’s originally from (I believe) the IBM developerworks site. In it they talked about the synchronized keyword and how a synchronized block of code is locked by the actual object, not the block of code itself. For instance, in the code below the authors state that even tho…