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..."
Friday, April 29, 2005
Thursday, April 28, 2005
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); "
Monday, April 25, 2005
Thursday, April 21, 2005
Wednesday, April 20, 2005
Tuesday, April 19, 2005
Monday, April 18, 2005
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)
"
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)
"
Wednesday, April 13, 2005
Tuesday, April 12, 2005
Welcome to www.ExperimentalStuff.com
Welcome to www.ExperimentalStuff.com
-Brazil
-ChorusOS
-GCold
GCspy
-HotSwap
-JIntroTool
-JRMS_multicast
-JavaCC
-Java_Make_Tool
-Uqbt
-Walkabout
-mwpbp
-Brazil
-ChorusOS
-GCold
GCspy
-HotSwap
-JIntroTool
-JRMS_multicast
-JavaCC
-Java_Make_Tool
-Uqbt
-Walkabout
-mwpbp
Wednesday, April 06, 2005
Sunday, April 03, 2005
Subscribe to:
Posts (Atom)