I need to design tabs shown in the attached document. I designed some but need your help with the rest. Could you create them using 'Pools Tab' code as a blueprint so the programming outline in all the tabs look similar if at all possible? Password for the document is 'J@V@'. Please let me know if you require any additional information or cannot open the document.
'Pools Tab' code -

import java.text.*;

import javax.swing.*;

import java.awt.event.*;

import java.awt.Container;

import java.awt.*;

public class Pools extends JPanel

{

//private JFrame mainFrame;

private JButton calculateButton;

private JButton exitButton;

private JTextField lengthField;

private JTextField widthField;

private JTextField depthField;

private JTextField volumeField;

private JLabel lengthLabel;

private JLabel widthLabel;

private JLabel depthLabel;

private JLabel volumeLabel;

public Pools()

{

//mainFrame = new JFrame("Pools");

calculateButton = new JButton("Calculate Volume");

exitButton = new JButton("Exit");

lengthLabel = new JLabel("Enter the pool's length (ft):");

widthLabel = new JLabel(" Enter the pool's width (ft):");

depthLabel = new JLabel("Enter the pool's depth (ft):");

volumeLabel = new JLabel("The pool's volume is (ft^3):");

lengthField = new JTextField(5);

widthField = new JTextField(5);

depthField = new JTextField(5);

volumeField = new JTextField(5);

//Container c = this.getContentPane();

//this.setLayout(new GridLayout(5,2));

this.setLayout(new FlowLayout());

this.add(lengthLabel);

this.add(lengthField);

this.add(widthLabel);

this.add(widthField);

this.add(depthLabel);

this.add(depthField);

this.add(calculateButton);

this.add(exitButton);

this.add(volumeLabel);

this.add(volumeField);

calculateButton.setMnemonic('C');

exitButton.setMnemonic('x');

calculateButtonHandler chandler = new calculateButtonHandler();

calculateButton.addActionListener(chandler);

ExitButtonHandler ehandler = new ExitButtonHandler();

exitButton.addActionListener(ehandler);

FocusHandler fhandler = new FocusHandler();

lengthField.addFocusListener(fhandler);

widthField.addFocusListener(fhandler);

depthField.addFocusListener(fhandler);

volumeField.addFocusListener(fhandler);

this.show();

}

class calculateButtonHandler implements ActionListener

{

public void actionPerformed(ActionEvent e)

{

DecimalFormat num = new DecimalFormat(" , ###.## ");

double width, length, depth, volume;

String instring;

instring = lengthField.getText();

if (instring.equals(" "))

{

instring = " 0 ";

lengthField.setText(" 0 ");

}

length = Double.parseDouble(instring);

instring = widthField.getText();

if (instring.equals(" "))

{

instring = " 0 ";

widthField.setText(" 0 ");

}

width = Double.parseDouble(instring);

instring = depthField.getText();

if (instring.equals(" "))

{

instring = " 0 ";

depthField.setText(" 0 ");

}

depth = Double.parseDouble(instring);

volume = depth * length * width;

volumeField.setText(num.format(volume));

}

}

class ExitButtonHandler implements ActionListener

{

public void actionPerformed(ActionEvent e)

{

System.exit(0);

}

}

class FocusHandler implements FocusListener

{

public void focusGained(FocusEvent e)

{

if(e.getSource() == lengthField || e.getSource() == widthField || e.getSource() == depthField)

{

volumeField.setText(" ");

}

else if(e.getSource() == volumeField)

{

volumeField.setNextFocusableComponent(calculateButton);

calculateButton.grabFocus();

}

}

public void focusLost(FocusEvent e)

{

if(e.getSource() == widthField)

{

widthField.setNextFocusableComponent(calculateButton);

}

}

}

}

Ezzaral commented: No code tags and asking others to complete your work. -3

Recommended Answers

All 7 Replies

No we certainly won't do it for you. It's your work you have to do it. Also put code tags to your code if you want somebody to take a look at it.

First of all you don't say which tabs you couldn't do. Yes you did the Pool tab on your own, but which tabs you did and work and which don't work?
So I would suggest to post the code of the tab that you are having problem with.
ONE tab at a time. Describe what is your problem, the errors you get, what the tab currently does and what it should do

Could you create them using 'Pools Tab' code as a blueprint so the programming outline in all the tabs look similar if at all possible?

Yes, rapture he was asking for us to complete his code. But if he has already done part of it, he can try and do the rest and we will help with problems he is having, provided of course we see some code

Yes, rapture he was asking for us to complete his code. But if he has already done part of it, he can try and do the rest and we will help with problems he is having, provided of course we see some code

technically, he asked if we could. so the answer to his question would either be 'yes' or 'no'

@rapture : Yes he was certainly asking for us to complete the code and that's the reason I gave him a straightforward NO.

lol - I guess I just couldn't believe that someone would ask us to do their work. My thought was more like "can you do something this way?" but not "you" just more like can "it" . . .

Well, I'm working on something similar, I guess nobody wants to do my work for me either. crap, there goes my backup plan. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.