What is the component called in a GUI ?
I am designing an application where I need to show certain usernames besides along with the points they have scored in a game.I don't want to do it in a table.I want to use the component shown in the picture below.But I do not know its name.And yes,is it available in Java ?

Dani AI

Generated

What you describe is essentially a columned list (a table-like control) with sortable columns and the small drag handle at each column boundary for resizing. The tiny "<-|-&gt;" you mentioned is the column-resize handle on the header, not a per-row selector. — that is why it looks like a table but without visible grid lines. — your question about the arrow was on point.

A quick recipe for Swing (common, stable option): use a table model and a table, enable header sorting, and remove the grid and inter-cell spacing so rows look like a clean list.

DefaultTableModel model = new DefaultTableModel(data, cols);
JTable table = new JTable(model);
table.setShowGrid(false);
table.setIntercellSpacing(new Dimension(0, 0));
table.setFillsViewportHeight(true);
table.setAutoCreateRowSorter(true);  // click header to sort
table.getTableHeader().setReorderingAllowed(false);

To make rows look less “tabular” further customize cell renderers (remove borders, adjust padding) or apply alternate-row coloring.

If using JavaFX (recommended for newer UI work), TableView gives the same features and is styled with CSS. Typical setup uses TableColumn items, PropertyValueFactory for cell values, and CSS to remove grid lines or change separators.

Troubleshooting tips: numeric columns need comparators for correct numeric sorting; column widths can be auto-sized or fixed depending on policy; if the header drag handle is not obvious, test with different LookAndFeels or CSS (JavaFX) because the visual affordance is LAF-dependent. For reference and examples see the official docs for table controls: Swing JTable tutorial and JavaFX TableView tutorial.

Recommended Answers

All 3 Replies

Is it a Combo box class you are looking for?

No,not the Combo Box. I am referring to the table like view with the sorting option.It is kinda table but without the lines for the rows.They also have the expand or shrink option like a little <-|-> at the border of each field.

So what's the functionality of the arrow? Is it a selection? If so, you could implement a table cell to use a combo box (selection), so it is a part of the table. It is all about how you compose components together in the rendering.

PS: JTable also allows you to resize each column. Not sure what <-|-> means...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.