JPanel used for graphics
| Newsgroups | gmane.comp.embedded.carlsbad-cubes |
|---|---|
| Message-ID | <[email protected]> |
I'm trying to adapt some existing programs to use Swixml. Most of the conversion is pretty straightfoward, but I'm not sure about the approach to use for a JPanel used for graphics -- specifically a panel where paintComponent() is overridden. It appears that the way to do this is to register a new tag for this subclass of JPanel that I've defined. Is this the correct approach? This got me to thinking about other approaches. The Swix engine could check to see if a variable to which a tag is bound already has a non-null value. If it's null, then it should create a new instance as it does now. If it's non-null and it's an instance of the appropriate type, then the xml attributes should be applied to the existing value. I'm not sure whether it's an easy solution to any other problems, but it would be a simple solution to my subclassing problem. I'd appreciate it if someone could just give me a quick conformation or correction to the question of whether my subclassed JPanel is best implemented by registering a new tag. Thanks, Fred