• Post Reply Bookmark Topic Watch Topic
  • New Topic

to show the Report  RSS feed

 
Sandeep Mukherji
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi to all,

I have created a java frame (say frame a). The Objective is to show a second java frame on clicking on the "View" button on the frame a, having the inputted infommations of frame a on it. For this I am using JLabel. On the Label i have used html tags. Something like ...

But is there any other better way to get the objective.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sandeep Mukherji:
But is there any other better way to get the objective.


You would do well to describe in greater detail exactly what your objective is. One thing that comes to mind here is not to display another JFrame (I assume that you're using Swing since you show code for a JLabel), but a dialog of some sort, either a JDialog or a JOptionPane.

Also, if what you are trying to do is to display tabular data, you may want to consider displaying a JTable in your dialog with the data derived from "frame A".
[ April 26, 2008: Message edited by: pete stein ]
 
Sandeep Mukherji
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a JFrame (yes, I am using Swing components) having some JComboBoxes, textfields and a table. This when i select some value from a combo box then the other few comboboxes are getting populated. User have to input some texfelds, and certain cells of the table to fetch the other cells data on tab press. in the back end the database is also used. Now the frame have a button at the end "view" and another "save". On clicking on "save" the whole data of the form goes to a table of the data base. What I exactly want is that when user clicks on the view button, he/she should see a next frame having the heading "Generated Invoice" and the data in the tabular form. In a format of their Invoice. Their Invoice format is in a tabular form. But the table is not regular.
I hope this explains.
Many Thanks.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that makes a lot more sense to me, thanks. So your question in my mind is, how to best format the data into some pleasing and informative view, and then display this. As to formatting the data, there are many ways to do this including using JTables, using HTML, and playing with various layouts. The discussion of this could be long and complex, and I think is something that you're just going to have to play with.

As to displaying it, I recommend that you somehow package your data into a JPanel and then again I recommend that you show it in some form of dialog, again either a JDialog or a JOptionPane.

If you need some more specific recommendations, consider creating and posting a very simple version of your program that is compilable, so that we can run it, alter it, tinker with it.

As always, good luck.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!