2

I want to create GUI like spread sheet. With resizeable cell size, filled with colour, Zoom in and zoom out etc features. Can I use draw2d for this?.

Is there any grid like widgets available in any Java based GUI frameworks? Or do I need to draw rectangle in rows and columns?

Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68

1 Answers1

5

Have a look at the Nebula project in Eclipse. It has widgets with some of the features that you need.

http://www.eclipse.org/nebula/

The widgets which might be of most interest to you are:

Some years ago, before Nebula was in a usable state I needed a flexible grid control. At that time I found and used KTable. But I think it is no longer maintained regularly but it was simple to use and served my purpose.

http://sourceforge.net/projects/ktable/

aaiezza
  • 1,297
  • 3
  • 11
  • 21
Waqas Ilyas
  • 3,116
  • 1
  • 17
  • 27
  • Yes I know about nebula project but I don't have any data(Numeric/string/image etc) to be displayed in cells. Just I want to display array of cells in different colours and can be made shrinkable in sizes. When user clicks on any cell then I want to invoke particular action. See the snapshot in original post. – Chandrayya G K Dec 28 '12 at 06:42
  • Sorry Not able to attach the snapshot. – Chandrayya G K Dec 28 '12 at 06:48
  • Perhaps you can host your image somewhere else and post a link? The basic SWT `Table` control or the abstraction over it provided by `TreeViewer` has a lot of features. One thing however that is problematic is the height of a row. In this table (on Windows at least) you cannot have different heights for individual rows. But if you do not need this and all you need is varying sizes for columns and different colors for cells then a `TreeViewer` ought to be enough. I can link some snippets for you to start, but I would like to see that image of yours to correctly understand your needs – Waqas Ilyas Dec 28 '12 at 17:13
  • But if you are talking about spreadsheet like grid, you are actually talking about a lot of more advanced features that a simple `Table` cannot fulfill. Like varying sizes of rows, fixed columns or rows, column or row headers, merged cells etc. – Waqas Ilyas Dec 28 '12 at 17:14