0

does anyone know how to fill the JTable with the binary values such as if we have 2 variables a and b the table should be filled in as follows:

a b
1 1
1 0
0 1
0 0

any suggestions would be useful..

thanks

2
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by nilay84
0

does anyone know how to fill the JTable with the binary values such as if we have 2 variables a and b the table should be filled in as follows:

a b
1 1
1 0
0 1
0 0

any suggestions would be useful..

thanks

well to convert a string to binary look here:http://stackoverflow.com/questions/917163/convert-a-string-like-testing123-to-binary-in-java
after that you just use the method in the jTable setValueAt(Object aValue, int row, int column) method to do the rest. Take a look here for more information on JTables:http://docs.oracle.com/javase/7/docs/api/javax/swing/JTable.html

0

i dont want to get the binary representation of a string i need to create a truth table in java?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.