Expense Program for Java

A program that allow the user add different expenses and insert the am

Page 1 of 1

3 Replies - 5953 Views - Last Post: 28 February 2009 - 06:04 PM Rate Topic: -----

#1 cmc1307   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-February 09

Expense Program for Java

Post icon  Posted 28 February 2009 - 04:06 PM

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.JOptionPane;

public class BeginProgram extends JFrame
{
ContentPane = new JPanel (new BorderLayout());

public BeginProgram()
{
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame = new JFrame ("Expense Tracker");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
ContentPane.add("Start", BorderLayout.CENTER);
ContentPane.add("Exit", BorderLayout.PAGE_END);
final JOptionPane optionPane = new JOptionPane (
"Would you like to start Expense Tracker", JOptionPane. QUESTION_MESSAGE,JOptionPane.YES_NO_OPTION);

}


}

Is This A Good Question/Topic? 0
  • +

Replies To: Expense Program for Java

#2 BigAnt   User is offline

  • May Your Swords Stay Sharp
  • member icon

Reputation: 102
  • View blog
  • Posts: 2,392
  • Joined: 16-August 08

Re: Expense Program for Java

Posted 28 February 2009 - 04:08 PM

Please post the code like: :code:

Also specify what problems/errors you are encountering
Was This Post Helpful? 0
  • +
  • -

#3 cmc1307   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-February 09

Re: Expense Program for Java

Posted 28 February 2009 - 05:43 PM

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.JOptionPane;

public class BeginProgram extends JFrame
{
ContentPane = new JPanel (new BorderLayout());

public BeginProgram() 
{
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame = new JFrame ("Expense Tracker");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
ContentPane.add("Start", BorderLayout.CENTER);
ContentPane.add("Exit", BorderLayout.PAGE_END);
final JOptionPane optionPane = new JOptionPane (
"Would you like to start Expense Tracker", JOptionPane. QUESTION_MESSAGE,JOptionPane.YES_NO_OPTION);

}


}



I have just started computer science class and I want to make a program for a business trying to calculate the profit earned after subtracting the expense. My main problem is that I'm not sure how to get a window to come up to start my program.
Was This Post Helpful? 0
  • +
  • -

#4 BigAnt   User is offline

  • May Your Swords Stay Sharp
  • member icon

Reputation: 102
  • View blog
  • Posts: 2,392
  • Joined: 16-August 08

Re: Expense Program for Java

Posted 28 February 2009 - 06:04 PM

Well if you just started Java I wouldn't recommend doing a GUI I would recommend starting with a console based app until you get the hang of the syntax and various Java API classes and such.

Just remember:

Learning Java is like a pyramid. You can't start near the top (GUIs) and wonder why it comes toppling down on you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1