Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (anonymous):

HI, AM A JAVA NOVICE AND I WOULD LIKE TO KNOW HOW I CAN DESIGN A HEXADECIMAL CALCULATOR USING THE javax.swing package. AND MANIPULATING IT TO CAHNGE COLOR F THE BACKGROUND AND THAT OF THE TEXT. THANK YOU.

OpenStudy (anonymous):

First of all: turn CAPS off. Secondly: SWING is used to create GUIs. Overall, I think the answer is yes.

OpenStudy (carlsmith):

Are you asking how to do a calculator that handles hexadecimals or how to change colours when using a particular Java package? I don't think people really understand the question.

OpenStudy (anonymous):

yes, this will require import java.swing.*; // for gui, layaout, borders, panels buttons etc import java.awt.*; // to handle events import java.io.* you need to make sure that your program does not crash if someone inputs something other than hexadecimals. Do you want a calculator or a converter? you might consider radio buttons to select the color, possibly menu items. Do you want your program to prompt your user for input? This is sort of a two part question. I think that it would be best to figure out the logic if the program first -- I would design a class to handle the calulations something like: class Converter{ private long input; String output; prompt user for input convert user input into data stream object method to perform calculation ( what is the algotithm you are going to use to convert base ten to 16 or does the math class have some code for that that you can reuse? are you going to use a queue or an array to store data? } just start writing some methods possibly draw a picture first (to be honest this is not a very simple assignment) after that then you can make an applet to display and run your program. Remember that you applet is going to extend from JApplet and will implement action listener you need a panel to display everything, a JTextField to get user input, and a button that reuns your program at the bare minimum. Hopethat can get you started...

OpenStudy (anonymous):

In the first phase, all i need is a shell on how the calculator will look like (interaction is not yet an issue), replacing 0-9 buttons with 0-F and the +, -, / and * with AND, OR, XOR, NOR and NAND as operators. Am sorry it wasn't clear. Thank you all.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!