Campbell Ritchie wrote:Have you tried double buffering? You set that by passing true to one of the overloaded constructors of (I think) the JPanel class.
Richard Tookey wrote:I don't understand your question! You already are handling the events! What problem with this are you experiencing?
You should note that many USB to RS232 adaptors do not provide true RS232 signal levels and may not work with devices that do need proper RS232 signal levels. Also, you need to establish the pedal parameters such as baud rate, number of stop bits, parity and handshaking method. If , as I suspect, you don't have a data sheet for the pedal then you can determine the parameters using an oscilloscope.
Maneesh Godbole wrote:To remove use Container#remove(Component child)
To add use Container#add(Component child)
You will need to also call revalidate as well as repaint to ensure the UI refreshes after any add/remove operation.
Instead of adding/removing panels, you might also want to considering refreshing the image or using a CardLayout
Matthew Brown wrote:Java doesn't really have multi-dimensional arrays. Instead, what it has is arrays-of-arrays. Given that, does that number make sense now?
Darryl Burke wrote:You first. How many do you think?
Winston Gutkowski wrote:
Fandy Akhmad wrote:If print out in the method [getNilai()]
I get null value.
If i print out in the current method: [setData(String data)]
I get the value that i wanted.
OK, so why do you think that is?
Hint: What are you doing differently?
PS: Please don't use bolding unless you really need to. See our KeepItDown (←click) page for details.
Campbell Ritchie wrote:I cannot see what is going wrong in that code. Please tell us what printouts you get from that setData method.
Your getNilai method is incorrectly named, because a getXXX method should return the field (or a copy of it).