Java Tutorial 49 (GUI) - JTable

preview_player
Показать описание
Java Tutorial 49

In this Java tutorial, you will learn how to make a table by using the JTable.

UPDATE: 12/09/12
At 8:15, I meant to say if this setFillsViewportHeight is set to true, the view port, (The height of the table without scrolling) will resize in height to fit all data. Otherwise, it will set on your preferred view port size and it might need to have a scroll bar so you could see all your data.
Рекомендации по теме
Комментарии
Автор

Awesome tutorial, I love the simple shortcuts to make otherwise advanced things

ppgab
Автор

Great tutorial! I will not use inner class for table (because I need several semi-looking tables on one program), but this tutorial helped me on "how to add features to your table". You got like and a new subscriber.

WispYart
Автор

Hello, can you please give a quick explanation about adding an image to a cell !
-thanks

FenixBladeOfTruth
Автор

Sorry, I shouldn't have said that. What I meant to say is whether or not the height of this table is always made large enough to fit all the data inside of this table's view port.

JohnGizdich
Автор

I want to 'title 1' column cell text equal "0.00" 'title 2' column cell can not type. (only same row).

I want to 'title 1' column cell text not equal "0.00" 'title 2' column cell can type. (only same row).

How to do this. please help.

sameerawijekoon
Автор

Excellent video bro!
Helped me a lot.

YengetoSan
Автор

Yes, I added that as an annotation as well! I can't believe I've made that mistake though.. :S

JohnGizdich
Автор

hi my name is Alex, I need some help how do I create a table that performs multiplication between 2 columns and sets the result in the third column

alexcosta
Автор

I have a problem guys, i have made an aplication and i want to add the table to button, so when i press this button it shows the table . ive tried use mouselistener but it doesnt work how should i do this ?

Asphar
Автор

im getting an error when i add columns.
what should i do?

promori
Автор

this video helped me a lot thank you so much

alphabalde
Автор

very easy to understand this tur, well done, tks so much :)

duynguyenabo
Автор

Could you use this to create a 2048 game?

jpdprogramming
Автор

How do you make a splash screen? PLEASE REPLY!

Dustinlop
Автор

+John Gizdich

my program don't have any error again, but it doesn't change color my table, but disable cell to editable is worked

this is my code

DefaultTableModel data = new DefaultTableModel(null, header){
@Override

public boolean isCellEditable(int row, int column) {
return false;
}
public Component r, int data, int column)
{
Component c = mytable.prepareRenderer(r, data, column);
if (data % 2==0)

c.setBackground(Color.GREEN);

else

c.setBackground(Color.BLUE);

return c;
}
};


where's my mistake?

EdwardPanjdjaitan
Автор

Ye, I don't think everyone will read the description though. I'd put an annotation in the video.

Sintaxx
Автор

oh, thank fuck... Someone who will explain a JTable to me and actually talk!

ethanwasme
Автор

Thanks a lot ur an excellent teacher...

TysonGill
Автор

nice video mate - rare to find a good jtable vid on youtube. do you do one on JTableModel?

also @11:07 - surely the variable names matter because you're overriding the method so the signature needs to be the same? maybe i'm remembering wrong XD

nickwoodward
Автор

Nice presentation John. I would suggest though as some others have that you might consider just speeding up your speaking style a little. Nice clear tutorial though. Thanks.

arthurmee