0

I have a floorplan type program that allows the user to drag and drop items onto the plan (haven't got the drag and drop working yet). Each item has an associated labor cost and price that is stored in the object class for each item.

When the user clicks on the Get Estimate button I have a new window that pops up as in the following image.

http://img5.imageshack.us/img5/5439/2wei.jpg

I then want to try and format the text as in the image shown. I have the window working with a JScrollPane and the buttons. I assume when I get the items working that I will pass a reference to my array of items so that I can call item.getPrice() to get each item's cost and then display it as in the image.

What I would like to know is, what is the best way to format and display the data as shown with tabbed columns using the dynamic data?

Thanks!

4

1 回答 1

0

如果传递给 a 的字符串以JLabeland 开头和结尾<html></html>它将被解释为 HTML。

因此,考虑到相当复杂的布局和样式元素,例如用水平线分隔的标题等,并假设表格在创建窗口后是静态的,最简单的方法可能是使用单个JLabel并将文本格式化为一个 HTML 表格。

于 2013-10-26T08:53:55.813 回答