java

how to set the report virtualizer parameter for jasper reports in java

How to set the REPORT_VIRTUALIZER parameter for jasper reports i java ...

How to toggle the option returned by ConnectivityManager.getBackgroundDataSetting() ?

Did anybody watch jsharkey's battery life google io presentation ? How does one toggle the option returned by ConnectivityManager#getBackgroundDataSetting() in the emulator ? ...

Wrong packing of JFrame using JPanel in borderlayout

Hello there. I am writing a simple application in Java that does some particle simulation on a bunch of sheep (don't ask). For this I want a window with a JPanel for graphics (which will be resizable with a simple combobox that contains some standard resolutions) and some other elements like buttons to start and pause the simulation etc....

Best practices for processing input HTML content at server side in java

I would like to implement content management system with RDBMS in java/j2ee, and would like to know the best practices for handling input HTML content Below are the few doubts I have got, am sure there are lots of other things to take care.. Do we need to escape HTML tags and special characters before we save HTML content to database ...

Setting the generated source directory for annotation processors in Maven

I'm trying to move a build which generates sources using an annotation processor to Maven. I've tried configuring the maven-compiler-plugin as follows: <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <fork>true</fork> <compilerArgument>-s $...

Is HTTP PUT supported in J2ME?

I just noticed a strange thing in MIDP 2.0 API: The HttpConnection class apidocs make explicit references to methods GET, POST and HEAD, but no other methods. Does this mean that they are not supported? http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/io/HttpConnection.html I also tried checking the MIDP 2.0 spec, bu...

GUI program, problem with tabbedpanes

I am creating a GUI program using MVC which should look like this.. I have created a Window and Panel class. I am thinking of creating the Input and Display tabs in the Panel class and then creating two more classes, InputPanel and DisplayPanel. So the InputPanel will contain the stuff in this picture under the Input tab and same for t...

Android app components - a word of advice needed

I am a complete newbie to Android development; Basically, I am about to write an application, that will let the user to take photo, which (with a bunch of extra data) will be submitted to the remote webservice. So I'm guessing I will need: A Photo-taking application (Activity) that will gather all the extra data and put in the SQLite...

Passing Locale details via Jasper-Reports to JFreechart

I'm adding Internationalization into a Tapestry web-app which uses Jasper Reports to generate normal tabular reports and also charts and graphs via JFreeChart. Using the Jasper REPORT_LOCALE parameter, I can set the Locale for Jasper reports and this works beautifully for the tabular reports but it doesn't work for the JFreeChart report...

change the class loading order google app engine java

I am trying to create an application on google app engine using struts2. Struts2 internally uses freemarker .One of the Freemarker framework classes suppose X internally uses a class javax.swing.Treenode which is not in google app engine jre white list. Now in order to run my application i created a new class X in the same package struct...

What is the best way of opening PDFs from a JSP?

Hello, I would like some guidance on the best way of launching PDFs from a browser. I have a JSP that takes some parameters and based on this downloads a PDF from my Documentum server. The files are stored on my local file system. I then provide the user with a bunch of links to the PDFs so they can click on them to launch the PDF. ...

Need some help with String.format

Hi. I'm trying to find a complete tutorial about formatting strings in java. I need to create a receipt, like this: HEADER IN MIDDLE '''''''''''''''''''''''''''''' Item1 Price Item2 x 5 Price Item3 that has a very long name.... Price '''''''''''''''''''''''''''''' Netprice: ...

Change button text without changing button size

Hello, I'm using a borderLayout to arrange my components in a JFrame and a Box(BoxLayout.X_AXIS) to put buttons next to each other. But it creates two problems: I want the buttons to have the same size, but it automatically resizes them to fit the text within them (especially annoying when I change the text inside a button at runtime)...

How does "this" escape the constructor in Java?

I've heard about this happening in non thread-safe code due to improperly constructed objects but I really don't have the concept down, even after reading about in in Goetz's book. I'd like to solidify my understanding of this code smell as I maybe doing it and not even realize it. Please provide code in your explanation to make it stick...

reassigning JList & JComboBox data

I've been looking through the Java API, but have had no luck in working this out. After you initiate a JList, is there any way to replace, or reload the 'data' string? I've also been looking to do the same thing with a JComboBox. String[] data = {"one", "two", "three", "four"}; JList dataList = new JList(data); ...

Java and .NET. Software written using both technologies.

I'm trying to understand trends of the languages. This might be not a "real programming question", but i hope people will correct me promptly. Currently there are two languages/trends/technologies that i'm interested in: Java and .NET. These are two worlds. There's an opinion that: 1. Java is most often used in connection with Oracle...

how to use JRSwapFileVirtualizer for jasper reports in java

how to use JRSwapFileVirtualizer for jasper reports in java, this is the code which i use.. JRSwapFileVirtualizer virtualizer = null; virtualizer = new JRSwapFileVirtualizer(10000, new JRSwapFile("F://", 1000, 1000), false); param.put(JRParameter.REPORT_VIRTUALIZER, virtualizer); xmlDataSource = new JRXmlDataSource(reportFile,"/table/t...

Db2 connection problem with java.

I am having problem with DB2. I just installed the db2 as a db2admin and with a password. When i try to connect to database it is success full and while running any simple select query it give me following error:- DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.LOGIN, DRIVER=3.57.82 I have a database named onp and a tabl...

problem with putting things inside a tabbed pane

I need to put check boxes inside tabbed panes, but they are always on the outside like this I want to put the murder check box inside the Input tab. This is what I have in my code import model.*; import java.awt.*; import javax.swing.*; public class Panel extends JPanel { JPanel panel = new JPanel(); public Panel(Prison p...

Flicker free AWT application

I'm trying to write a silly little app using Java and AWT. It simply runs and animates some shapes, so as a first step, I created a simple app that clears a canvas with fillRect every 50ms. The problem is, my app flickers every now and then with the underlying window colour. Google is failing me when it comes to finding simple hello-wo...