Friday, April 29, 2005

Java Forums - Java 1.5 doesn't want to indent XML output?

Java Forums - Java 1.5 doesn't want to indent XML output?: "Re: Java 1.5 doesn't want to indent XML output?
Author: js Oct 20, 2004 2:40 PM (reply 2 of 16)
I got bit by this one too. After spending quite a while poring through the Java source, here's a solution:

TransformFactory factory = TransformerFactory.newInstance();
factory.setAttribute('indent-number', new Integer(4));

This works with Java 1.5 but (sigh) the setAttribute() call causes an IllegalArgumentException in 1.4. So wrap the setAttribute() in a try/catch and throw away the IllegalArgumentException..."

Thursday, April 28, 2005

generics-tutorial.pdf (application/pdf-Objekt)

generics-tutorial.pdf (application/pdf-Objekt)

Java 5.0 Generics :: own Class definition

Java Forums - cast problem: "public class SomeClass { private Map map = new HashMap(); public SomeClass(Set set) { for (Iterator i = set.iterator(); i.hasNext();) { map.put(i.next(), Boolean.FALSE); } } } Set extSet = new HashSet(); SomeClass someClass = new SomeClass(extSet); "

RockSaw Raw Socket Library

RockSaw Raw Socket Library

Java Pro – Implement Raw Sockets

Java Pro – Implement Raw Sockets

Friday, April 15, 2005

howto:horizontal_table_scroll [SwingWiki]

howto:horizontal_table_scroll [SwingWiki]: "By default, JTable scrolls only vertically, not horizontally (and cell width is automatically adjusted to fit into the available space, even in JScrollPane). If the table contains a lot of columns (10 ), the columns will become too short for any use, so you will have to enable horizontal scrolling.

To enable horizontal scrolling,

The downside to this method is that you have to set cell width manually. You might try to put the table into a JPanel of fixed size, without all this tweaking, and then put the enclosing JPanel into a JScrollPane. However, this leaves you with the problem of Missing JTable Header.

First, call table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF) to turn off automatic resizing. Then, manually set cell width for each column. In earlier JDK versions (1.3), you will also have to activate the horizontal scrollbar by hand - create JScrollPane with the following constructor call JSCrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS)
"

Online Digital Picture Viewer

Online Digital Picture Viewer