[jboss-user] [JBoss Seam] - Re: A customer JSF tag to display Graphics2D in Seam PDF out

EricJava do-not-reply at jboss.com
Fri Dec 21 02:38:08 EST 2007


Yes indeed!  In my blog post, I wrote: 

anonymous wrote : One interesting thing to notice is that this button is using the Linux look-and-feel, because, in this case, the server was running Linux. If this server had been running on some other operating system, the button would, by default, take that other operating system's look-and-feel. This is something to be aware of when using Swing components. All Swing components have system-dependent look-and-feel.

By the way, before you get everyone set on it, you might want to call the tag something other than "swing".  I set it up to use java.awt.Component as an argument, not a JComponent.  All Swing components are sub-classes of java.awt.Component, so you get them all for free.  But Component is simpler, with no complications from look-and-feel considerations, and more inclusive, than JComponent.  Here's a very simple Component I wrote to display a JFreeChart, for example, without Swing involved:

public final class ChartComponent extends Component {
  | 
  |     public ChartComponent(JFreeChart chart) { this.chart = chart; }
  |     private final JFreeChart chart;
  |     
  |     @Override public void paint(Graphics g) {
  |         chart.draw((Graphics2D)g, new Rectangle(getWidth(), getHeight()));
  |     }
  |     
  | }



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114898#4114898

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114898



More information about the jboss-user mailing list