-1

So I have some kind of impossible task, atleast for me. We got the task to create a Calculator with the Java WindowBuilder that looks and functions like a Windows 7,8 or 10 calculator. I'm not asking for a whole source code or something, but does anyone have some useful links or videos which could help me atleast get something barely useful finished until wednesday night ? Btw I'm not really experienced with Java, we program with COBOL on work, which really doesn't help me too much with this task.

I'd be glad if anyone could help me, and I'll likely follow up with some questions or posts if I start my

bmc444
  • 1

1 Answers1

-2

I would suggest use NetBeans 8.2 since it has a very good GUI Designer, but as you ask of WindowBuilder you can use the link to get an idea: https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-windowbuilder-tutorial/

The basic thing to know is that it gives user a tab called Palette to drag-and-drop components (in your case, JButton for the numbers and "+ - * / =" operators and maybe a JTextField for the output of the calculations) into a main frame called the JFrame. You can set layouts so the buttons and stuff align properly upon resizing the window.

The Properties tab can be used to add event listeners and other GUI details such as text color, size, font etc. Also, if you click the JFrame itself, you can set its preferred size, the ability to resize or not, if the window will be maximized by default etc.

I am not very familiar with WindowBuilder, but NetBeans disables changing the auto-generated code in the file editor. Though you can add run-time handlers and stuff for the components, and of course, edit the event listeners.