• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to create a Properties Window?  RSS feed

 
huang gang
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

how do you do?

I' like to ask how to create a proterties window? i.e. I want to create two frames in the main screen, one of them is a properties window, when I select an object in another window, the properties will be shown in properties window, just like most of the IDEs do.

I do not know which component is fitly, can any one help?
 
Brian Pipa
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://common.l2fprod.com/ has something that might work for you
 
huang gang
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks! l2fprod is a prefect library.

But what I want is not to show Bean info, I just want create a window to place my properties table in.
How could I create that kind of window? Should I use a JPanel or a JInternalFrame so that I can split between this windows and main window as weel as close it separately?


thanks anyway...
 
Brian Pipa
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't used the class/library myself, but the description says

Editing properties
This is the main job of the PropertySheet component, it puts together a list of properties and their editors. Each property is given a name, a type, a description.It also supports JavaBeans through BeanInfos and PropertyDescriptors.


Which makes me beleive that it does Beans, but it does other properties too. Maybe you actually looked at the javadocs/code and saw that it just does beans, but the paragraph above makes me think it does more.

Brian
 
huang gang
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, I did not make my words clear.

I can show the properties by myself (maybe I should use l2fprod ).
But what confused me now is that I need to put the proterties table into a panel or a frame, so that to make it can close sperately and split between other window.

i.e. I need a container, which is fitly?
I use a JPanel now and set it invisible when user close the properties window, but I think there must be some way more neat.

thanks!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What follows I copied from one of the Sun Forums, it was posted by
DrLaszloJamf (I think). I can't find the link, so I'll post the code,
because it seems to be similar to what you're trying to do.

 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Listing class in the post above comes from this thread.

Here's an example of how to launch a new window from an application. You can use a JFrame in place of a JDialog.


[ May 26, 2004: Message edited by: Craig Wood ]
[ May 26, 2004: Message edited by: Craig Wood ]
 
huang gang
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, these code does work,
but ...... I am still confusing in finding a fitly container for my properties table.

 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you describe the qualities a container would have to make it fit for your properties table?
 
huang gang
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for concern...

I need a container maybe a JInterFrame or JPanel, but it should has these features:

1.can be close sperately
2.can be split between main window
3.had better can float and dock.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Though it does not meet all the requirements in your last post, have you thought about using JSplitPane ?
 
huang gang
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, I use JSplitPane. But as you said, it is not satisfied.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!