Hi all,
I'm just getting to grips with java and have set my self a challenge to consolidate my learnings so far as well as implement new learnings.
I want to enter a load of possible things to do into sets and then randomly generate a set value, which is a suggestion of what to do(Geeky - know!) There will be numerous sets, a set for me and my partner - my dog - my son. A set for me and my partner - my dog - no son, etc - basically what i want is to be asked if son and dog are with us in modal boxes and then navigate to a relevent set depending on input. Then generate a suggestion.
I will add my code thus far - it may be ver different to what others would do but i'm using what i ve learnt so far. Now, I haven't use modal/dialog boxes in java but have in VB - a while back. So first thing i need to do is learn how to use them. What code do i use and what do i import? I want to add a yes/no box in the launch method. I have learnt how to set the result into a variable but I was learning with the open university and they shown us with there own classes which were prob a sub class of some sort.Any help would be greatly appreciated. Here is my code:
import java.util.*;
import java.awt.*;
import java.awt.event. *;
import java.swing.*;
public class Suggestion
{
Frame theFrame = new Frame();
Button addSuggestion = new Button();
//this order - Dan&Bren-Arial-Dylan
Set<String> YesYesYes = new HashSet<String> ();
Set<String> YesYesNo = new HashSet<String> ();
Set<String> YesNoYes = new HashSet<String> ();
Set<String> YesNoNo = new HashSet<String> ();
Set<String> BrenNoNo = new HashSet<String> ();
public Boolean arial;
public Boolean dylan;
public void launch()
{
theFrame.setSiz e(500,500);
theFrame.setLay out(newFlowLayo ut());
addSuggestion.a ddActionListene r(new ButtonListener( ));
theFrame.add(ad dSuggestion);
theFrame.setVis ible(true);
public static void main(String[] args)
{
Suggestion newObject = new Suggestion();
newObject.launc h();
}
}
Thanks for looking
I'm just getting to grips with java and have set my self a challenge to consolidate my learnings so far as well as implement new learnings.
I want to enter a load of possible things to do into sets and then randomly generate a set value, which is a suggestion of what to do(Geeky - know!) There will be numerous sets, a set for me and my partner - my dog - my son. A set for me and my partner - my dog - no son, etc - basically what i want is to be asked if son and dog are with us in modal boxes and then navigate to a relevent set depending on input. Then generate a suggestion.
I will add my code thus far - it may be ver different to what others would do but i'm using what i ve learnt so far. Now, I haven't use modal/dialog boxes in java but have in VB - a while back. So first thing i need to do is learn how to use them. What code do i use and what do i import? I want to add a yes/no box in the launch method. I have learnt how to set the result into a variable but I was learning with the open university and they shown us with there own classes which were prob a sub class of some sort.Any help would be greatly appreciated. Here is my code:
import java.util.*;
import java.awt.*;
import java.awt.event. *;
import java.swing.*;
public class Suggestion
{
Frame theFrame = new Frame();
Button addSuggestion = new Button();
//this order - Dan&Bren-Arial-Dylan
Set<String> YesYesYes = new HashSet<String> ();
Set<String> YesYesNo = new HashSet<String> ();
Set<String> YesNoYes = new HashSet<String> ();
Set<String> YesNoNo = new HashSet<String> ();
Set<String> BrenNoNo = new HashSet<String> ();
public Boolean arial;
public Boolean dylan;
public void launch()
{
theFrame.setSiz e(500,500);
theFrame.setLay out(newFlowLayo ut());
addSuggestion.a ddActionListene r(new ButtonListener( ));
theFrame.add(ad dSuggestion);
theFrame.setVis ible(true);
public static void main(String[] args)
{
Suggestion newObject = new Suggestion();
newObject.launc h();
}
}
Thanks for looking
Comment