Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #2011
| From | a24900@googlemail.com.remove-dii-this |
|---|---|
| Subject | Re: Thinlet and own JPane |
| Message-ID | <1184097587.369947.209980@r34g2000hsd.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <1184072315.848845.256630@w3g2000hsg.googlegroups.com> |
| Date | 2011-04-27 15:36 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui
On Jul 10, 2:58 pm, cool.ke...@googlemail.com wrote:
> hopefully you all know thinlet,
It's not so important that one really needs to know.
> (http://thinlet.sourceforge.net). I was trying to parse a simple xml
> file and take one of its components
A Thinlet does not contain separate Components unless you separately
added AWT-based JavaBeans, which you didn't.
> and then put it on my own swing
> panel.
Bad idea in many aspects. Bad on abstract level (mixing of paradigms)
and bad on technical level.
> Sadly I am not able to do this.
Of course not. The Thinlet is a single component, actually a
Container, an AWT Component subclass. The "components" in a Thinlet
are typically String descriptions plus data, not Component objects. A
Thinlet is one big text interpreter when run.
> Object c = thin.find("mainpanel");
"c" contains all you can ever find out about "mainpanel".
> thin.getComponent(c, "name"); // THIS SHOULD GET THE COMPONENT
> mainpanel
No, why should it? And all your shouting will not change it.
getComponent() only looks for JavaBeans, which have the internal
Thinlet-'type' "bean". But you are asking for a "panel" type. While a
"panel" has a "name" attribute, a "bean" doesn't.
> I wanted to get the AWT component named "mainpanel",
There is no such AWT Component in the Thinlet. There is a data
structure labeled "mainpanel" in the Thinlet, which is not an AWT
Component.
> defined in the
> xml file,
You have not define a "mainpanel" AWT Component. Just one single
Thinlet (which is an AWT Container) and which contains text
descriptions of components.
> and then put it on the panel with panel.add().
> Any idea how
> this is done?
It can't be done. What you want is not there. And if it would be there
you would asking for trouble by putting an AWT component on a Swing
JPanel.
Drop that giant hack called Thinlet and learn Swing programming.
> Is it possible to parse the xml file and then use parsed elements on
> your own panels, frames etc.?!
No. Learn Swing programming.
---
* Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Find similar | Unroll thread
Thinlet and own JPanels "cool.keanu" <cool.keanu@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000 Re: Thinlet and own JPane a24900@googlemail.com.remove-dii-this - 2011-04-27 15:36 +0000
csiph-web