7 Replies - 1238 Views - Last Post: 06 October 2013 - 01:45 PM

#1 Confounder   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-October 13

Getting started with first application in Java - interface or logic?

Posted 06 October 2013 - 10:06 AM

Hi All,

I am new to this forum and also to the world of programming. I have previously developed websites and have experience in HTML, javascript, CSS and ActionScript (Flash development). I am looking to learn Java and have been going through tutorials on here and on the web.

I am ready to start my first application for calculating gas and electricity bills and monitoring usage via canned reports. I know this can be easily achieved in Excel but thought I would develop a free application in Java which will also help me pick up the language.

Where do I start? I have Netbeans open but not quite sure if I should start with the logic, the calculations for working out your gas and electricity bills or I should start with designing the interface. The later is so tempting as it's the sexy aspect of development.

Any guidance would be appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Getting started with first application in Java - interface or logic?

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14158
  • View blog
  • Posts: 56,748
  • Joined: 12-June 08

Re: Getting started with first application in Java - interface or logic?

Posted 06 October 2013 - 10:24 AM

I would step back from the project and learn foundations (or the 101 stuff) about java.. THEN apply that to your project.

Read through the tutorial section.. pick up a book.. what ever gets you through the foundation.. after that it is substantially more easy to know where you want to go in making your program.
Was This Post Helpful? 0
  • +
  • -

#3 Confounder   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-October 13

Re: Getting started with first application in Java - interface or logic?

Posted 06 October 2013 - 11:21 AM

modi123_1, thanks for getting back.

One of the things I struggle with is applying the concepts to practical uses. I understand the concepts but not always sure where to apply them. I was thinking writing my own application will help me better understand encapsulation, inheritance and polymorphism in a practical way.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14158
  • View blog
  • Posts: 56,748
  • Joined: 12-June 08

Re: Getting started with first application in Java - interface or logic?

Posted 06 October 2013 - 11:25 AM

Okay.. so you are not new to java then? I am a bit lost on your particular level.

I mean if you know the java basics then you should be able to sit down, write out what you want this to do (in detail) and then pick apart sections into smaller areas were you can say "okay so for this object i need this data type, but this object has different needs so I need to make my own data type.. and these objects help feed into this GUI.. etc".
Was This Post Helpful? 0
  • +
  • -

#5 Confounder   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-October 13

Re: Getting started with first application in Java - interface or logic?

Posted 06 October 2013 - 11:33 AM

I am definitely a beginner.

Here is an example. The user of the application will be required to enter how many kilowatts of electricity they have used since the last period. The application will convert this to cubic feet. Shall I design the input form first or write the logic for converting KWh to cubic feet or does it not really make a difference?

I guess I am trying to separate out the visual elements from the calculations and logic and decide which part to work on first.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14158
  • View blog
  • Posts: 56,748
  • Joined: 12-June 08

Re: Getting started with first application in Java - interface or logic?

Posted 06 October 2013 - 11:37 AM

It really doesn't make a difference which comes first, but you need input to get data so slap a few textboxes on a form, and then get the back end working to do that math..
Was This Post Helpful? 0
  • +
  • -

#7 wviper3   User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 59
  • Joined: 06-October 13

Re: Getting started with first application in Java - interface or logic?

Posted 06 October 2013 - 12:44 PM

Create the GUI first. Eclipse is better than netbeans because it has a built in window builder. Use swing to make the window.
 
import javax.swing.*;

public class GUI extends JFrame{
      super("GUI");

      setSize(100, 100);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setVisible(true);
      
}



This will create a small screen. I may have forgotten something but you can use JTextFields for the user input.

wviper3
Was This Post Helpful? -1
  • +
  • -

#8 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12324
  • View blog
  • Posts: 45,424
  • Joined: 27-December 08

Re: Getting started with first application in Java - interface or logic?

Posted 06 October 2013 - 01:45 PM

Quote

Create the GUI first. Eclipse is better than netbeans because it has a built in window builder. Use swing to make the window.

Actually, always focus on the logic first. Design your program so it is easy to overlay whatever UI one wants (ie., Android, Swing, JOGL, Console, etc.).
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1