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);
}
}
Expense Program for JavaA 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
Replies To: Expense Program for Java
#2
Re: Expense Program for Java
Posted 28 February 2009 - 04:08 PM
Please post the code like: 
Also specify what problems/errors you are encountering
Also specify what problems/errors you are encountering
#3
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.
#4
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.
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.
Page 1 of 1

New Topic/Question
Reply



MultiQuote



|