I have byte array that consist of hex values like CA ,FA,21,33
But I want to list them in JList
as a single element CAFA2133
. In order to list them in JList I think I need to convert it to string
. So any recommendation?
You need to look at String.format() and the Formatter specifications.
e.g.
String.format("%02x", byteValue);
Iterate through the array and append each String.format()
result to a StringBuilder
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments