Hi, I am a beginner in Java . currently i m trying to make a calculator. So far i have made the GUI of the calculator but the problem is that i am unable to remove horizontal spaces between the rows of buttons. i want my calculator to look like the one we get with our windows operating system. There, the buttons are packed . can anyone help me out in removing those spaces. My code so far is as follows:
I'm sure you don't write code that is left aligned, so don't expect us to read it that way. The "Preview" button is there for a reason.
Edit your posting and post properly formatted code.
Joined: Oct 05, 2009
Thanks Brian. I will now try with GridLayout.
As for my left aligned code , let me clarify that to you: since i m a beginner,and since I have started studying Java all by myself just by browsing material and through books , and it's only a month that i have started studying Java, I am not practiced in writing the correct way you are referring.(I am still using notepad for writing my code and using command line for compilation.) i will now download some Integrated Development Environment so that my code is not left aligned or try to make it that way myself. Anyways , thanks for your suggestions.
Joined: Jun 13, 2009
I am still using notepad for writing my code and using command line for compilation.) i will now download some Integrated Development Environment
Me too, I use a simple text based editor and a command line for compiling this does not prevent you for using standard intendation of your code.
How hard is it to type spaces or add a tab character at the beginning of a line?
Properly formatted code will make it much easier to read and understand your code, thus prevent silly errors like mismatched brackets and so on.