Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1931

Creating a component by p

From "Ricardo Palomares Martine" <ricardo.palomares.martine@THRWHITE.remove-dii-this>
Subject Creating a component by p
Message-ID <ejmnl4-abc.ln1@Father.family> (permalink)
Newsgroups comp.lang.java.gui
Date 2011-04-27 15:36 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
Hi,

This may be a FAQ and/or a dumb question, but I haven't managed to get
all the information I need by SFTW (and, in particular, the Swing
Tutorial).

There is somewhat usual to have a JTextField for the user to type a
pathname, and a JButton next to it to launch a Choose File Dialog. In
fact, in the app I'm writing is going to be usual that I'd rather
create a custom component to tie both fields together.

But I'm not sure how to do that. I've thought of putting both
components (JTextField and JButton) inside a JPanel, and thus I would
write my custom component by extending a JPanel with two private
properties holding the text field and the button. Would that be
sensible or should I extend JComponent (which I think is more complex)?

TIA

-- 
If it's true that we are here to help others,
then what exactly are the OTHERS here for?

---
 * 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 | NextNext in thread | Find similar


Thread

Creating a component by p "Ricardo Palomares Martine" <ricardo.palomares.martine@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
  Re: Creating a component "CK" <ck@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
  Re: Creating a component "Robert" <robert@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
  Re: Creating a component "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000
  Re: Creating a component "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:36 +0000

csiph-web