Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #153
| From | "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: jtextpane has no comp |
| Message-ID | <1164132973.717246.107890@m7g2000cwm.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <1164131384.208120.191630@h48g2000cwc.googlegroups.com> |
| Date | 2011-04-27 15:25 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui bill turner wrote: > I am having a problem with jtextpane that I do not understand. It is > probably quite obvious, but I am not strong with Swing, so please be > gentle. I've spent time on the tutorials and googling, but there are > not samples nor any discussions that I've seen doing what it is I am > attempting to do. Essentially, when the app starts up, it tries to > initialize the display. Using the jtextpane setText method, the html is > loaded. After that is done, I display the number of components and it > is always 0. This means that my call to the method parseHtml() has > nothing to parse. This method loops over the components and tests to > see if the component is an instanceof a Swing component, such as > JTextField and, if so, sets a member variable of that type to the > component. I do this so that I have a handle to the various components. > Then, I call the method setOutput() and set the text value of the > various components. I am trying to load the current state of the data > for immediate display, which makes sense for this app. Think of an > editor that displays application properties or any other type of > current settings. It does not make sense to put in a button, in my > opinion, to load the data. However, it seems like that is what I need > to do as I can display the data just fine after an event (pressing my > update button, for example). I call the same two methods. So, how can I > get handle to the components before the initial display so that I can > set the dynamic content? Below is the method that builds the initial > display. the variable dataEntryPane is a member variable of type > JTextPane. I think you are confusing Swing components with HTML controls. JTextPane will parse an HTML file, but not very well, and it doesn't leave much interaction to the rest of the application. You'de be better off setting up a JPanel with the Swing components that you want in them. You may also want to look into JGoodies for form layout. --- * 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 | Find similar
Re: jtextpane has no comp "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:25 +0000
csiph-web