Hello guys. In NetBeans IDE, I've placed common-codec-1.10.jar in my libraries. Whenever placing this method in my code
It tells me that class, enum, or interface expected, and whenever placing
return Hex.encodeHexString(text.getBytes()); in my code, it makes me import org.apache.commons.codec.binary.Hex;
It tells me I need to change method return type to Hex, and it doesn't work for me. I got this information from here: http://www.bullywiihacks.com/t4108-ascii-hex-dec-conversions#22788
How would I use the above code to get Text From a Text Field and then convert the Text Values to Hex, and then print them?
I assume after I get the code to work, I can place said HEX in a string, store different parts of it in variables, and then have it print where I need to. This will basically be finishing my entire program(except the comboboxes, I'll get to that later) as I already got Dec to Hex Conversion and Dec to Bin conversion thanks to these lines of code:
- Code:
public static String toHex(String ascii)
{
return Hex.encodeHexString(text.getBytes());
}
It tells me that class, enum, or interface expected, and whenever placing
return Hex.encodeHexString(text.getBytes()); in my code, it makes me import org.apache.commons.codec.binary.Hex;
It tells me I need to change method return type to Hex, and it doesn't work for me. I got this information from here: http://www.bullywiihacks.com/t4108-ascii-hex-dec-conversions#22788
How would I use the above code to get Text From a Text Field and then convert the Text Values to Hex, and then print them?
I assume after I get the code to work, I can place said HEX in a string, store different parts of it in variables, and then have it print where I need to. This will basically be finishing my entire program(except the comboboxes, I'll get to that later) as I already got Dec to Hex Conversion and Dec to Bin conversion thanks to these lines of code:
- Code:
Integer.toString(variable , X)
X = 2 or 16 depending on which value I needed to return