Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data display

Status
Not open for further replies.

dinger2121

Programmer
Sep 11, 2007
439
US
Hello,
I am new to java - I have been programming in .net for quite some time.
In .net, there is a datagrid control which affords the opportunity to display data in a highly stylized format. For instance, you can use html in a form to highly customize the layout of table/grid "cells".
Is there anything in java that resembles this functionality?

thanks for any thoughts.

carl
MCSD, MCTS:MOSS
 
would I be able to bind that to database data, or would I just go through my dataset and create a new JLable for each record?
Is that recommended usage?

carl
MCSD, MCTS:MOSS
 
I don't understand how you like to bind it to database data. Of course you may store the html in a database - why not? And I don't understand the 'or' in your first question.
Code:
...
String htmlLabel = resultSet.nextString ();
JLabel jl = new JLabel (htmlLabel);
maybe you can show in pseudocode what you like to do.

I don't know .net.

You like to populate a Table? In that case, you normally format whole columns identically. The sun-swing-tutorials cover that, look for CellRenderer.

Whether that is recommendet depends on what you like to do in what context - whether it can be done in other ways - better, nicer, faster, more easy - it depends pretty much on your context.


don't visit my homepage:
 
in .net, you would just set the dataset (or List, basically any generic object set) to the datasource of the grid. you then call a databind method of the grid and that automatically binds the data.
The datagrid itself resides on the asp.net page. On this page, you declare the datagrid and then create a template for it using html - this is where the formatting takes place. So you are essentially binding a whole dataset to the grid, which knows that it is repeating so you don't have to use a loop to create a new row for each row in the dataset.

So I want to show all of the data, but not necessarily in a datatable type layout. I don't want the standard row and column view, I would like to be able to display it with some formatting.

hope that makes sense.

carl
MCSD, MCTS:MOSS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top