This week's giveaway is in the OCPJP forum.
We're giving away four copies of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) and have Paul Anilprem on-line!
See this thread for details.
Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!

Bobes Calin

+ Follow
since Nov 13, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bobes Calin

I was trying to say that when i want to sort the values from values

with the method sort from java.util.Collections class

it gives me an error:
Bound mismatch: The generic method sort(List<T>) of type Collections is not applicable for the arguments (List<JTableTest.Value[]>). The inferred type JTableTest.Value[] is not a valid substitute for the bounded parameter <T extends Comparable<? super T>>
This problem is when i modified the structure of the list:


Like i wrote up in the code the class Value implements the interface Comparable

and i override the method

7 years ago
I figured out. I modified the array list to

and added the values from DB to the table. In the getColumnClass method just return Value.class only for the first column.

Now i have problems with sorting...

doesn`t work now
7 years ago
Thanks Paul for reply.

If you want checkboxes in the first column then the getColumnClass() method for that column should return Boolean.class.

Sorry not making me clear. I have returned that, with the Value class.

The problem in this case is do i have to insert all the columns independently from the DB in the getValueAt(int row, int col) overrided method?

I need a way to insert all the data from DB in one move, all the columns once, like i am using to insert the values in the first column from the DataModel constructor

7 years ago
Hi everyone! I am trying to make a custom table for a DB and i am stuck.

I want only the first column to have a checkbox and others not.

Is there a better way to insert the values instead using the getValueAt ?

This is my code

7 years ago
Thanks Paul Clapham for the reply.

I figured out what the problem was that i needed to created the value object each time the loadTable() is called

then just use the model.loadTable() and everything is working fine

7 years ago
I tried in the button action listener

but it now it trows an exception

what i missed?

7 years ago
My bad i didnt post the rest of the code where the datamodel object is created.

and there is a button which is sending data to DB then i was tryingf to call

i was trying also to recall the loadTabel method but didnt work

7 years ago

I found an interesting example HERE and i made some modification in the table model to use the second column (with the checkbox).

The data that i put in that column are from a database column. The problem is when i want to reload the table the (fireTableDataChanged() is not working).

When i start the app the table loads the data but when i want to add or remove it doesnt refresh.

- the query is sent to the database but the table did not repaint.

Please tell me what i am missing

Here is what i modify

7 years ago
Thank you Carey Evans!
13 years ago
thank you. Yes the { "/sbin/ifconfig", "-a" } and it show me only the fisrt line from the output. Can you please show me a good working example?

Well i can see the mac address:

but i can`t see the network ip. On windows work this code:

in the first try is the localhost and the second should show me the network ip not I don`t get it why? on windows work and on linux not, and that`s why i need to capture the cosole output for the ip.

13 years ago
Hello guys! I want to capture the output from the linux console. More precisely i want to capture the mac and the address from the /sbin/ifconfig -a command. I have made a method but it doesn`t work.

If i run xterm or an application it works. How can i run linux command and receive the output on java?

13 years ago
yes you are right with the count.

i put it out from the loop and initialized with a with an int value on the server

but the same thing only one file is copied
I tried to send the number of files that are in the File[] array

in the client sendFileToServer()

and the server receiveFileFromClient()

but hte same thing, only the first file is send.
yes the server reads only the fisrt file. How can i do the loop? on what criteria?

Thank you!

I have a litle problem (i think) on my client server application. The aplication sends one file and not all that i give it to it.

here is the code for the server....

and for the client....

Can anybody show me how to send all the files? Thank you!