mo robertson

Greenhorn
+ Follow
since Mar 29, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by mo robertson

ok i have an integer called 'Price' which has been declaired on a class
i want to set price to a textbox, but it doesnt let me becuase its integer, string works fine. how would this be ?

h[count].Price= "" + jTextField7.getText ();
18 years ago
ok i found out why, it was because i was clearing the text fields before it. that was having some effect. however my array is letting me add as many holidays as i want, it should however max out at 50

18 years ago
this is a travel holiday package, which allows the user to input holidays, which are stored in an array then later saved to file. (the saved to file will be worryed about later) just now all im after is allowing the holidays to be stored in the array.

ok lets break this down a little, lets start by first adding a holiday to an array. im using textboxes for the input and a command button to perform the add action.
Add A Holiday To Array
Destination [_____________________]
Airport [_____________________]
Accomodation [_____________________]
Holiday_ref_no [_____________________]
Departure_date [_____________________]
Length_stay [_____________________]
Price [_____________________]
[ ADD ]

once you have filled in the fields it adds them details you input in them textboxes, to an array, where it holds that holiday. the array should allow me to add up to 50 holidays. if i add more than 50 it displays an error.
i added labels below the textboxes ( they will not be there in the final program) to display the holiday i added.
hope this helped understand what i mean
[ April 29, 2004: Message edited by: mo robertson ]
[ April 29, 2004: Message edited by: mo robertson ]
18 years ago
ok, let me explain first, what im trying to achive.
i currently have a GUI window called 'Ossian' and one class called 'Holiday'
basically i've got 7 textboxes, and an add button. Once u fill in all 7 textboxes with the info of the holiday you wish to add, you click the 'add' button, it adds that holiday to an array. the class holds all the varible values from the textboxes it has recived so they can be used around my program. however i have ran into a few problems doing this. maybe someone could point me in the correct direction. thanks alot
toothpick
here is my code i did myself, it runs but doesnt do as i require, im doing something wrong.
ALL IN BOLD I PUT IN MANUALLY, SO THATS THE CODE TO CHECK, SUNONESTUDIO DID THE REST KINDOF


[ April 29, 2004: Message edited by: mo robertson ]
[ April 29, 2004: Message edited by: mo robertson ]
[ April 29, 2004: Message edited by: mo robertson ]
18 years ago
woooooooooooooooooosh, ty alot.
18 years ago
**** Name Input ****

**** Stored ****

ok it runs, but doesnt work, it produces the following errors when i put my name in and hit the button.
java.lang.NullPointerException
at Stored.<init>(Stored.java:56)
at NameInput.jButton1ActionPerformed(NameInput.java:49)
at NameInput.access$100(NameInput.java:7)
at NameInput$2.actionPerformed(NameInput.java:34)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

18 years ago
ive added brackets left right and centre. cant see where to put it
18 years ago
we have been told to use this program. thus i dont know if its good or bad, and know very little java myself. i found this forum and thot it would help me, as i could ask experienced java programmers questions of why and how to do things. it seems to have worked so far.
meInput.java [64:1] ')' expected
Stored storedFrame = new Stored(String yourname);
^
1 error
Errors compiling jButton1ActionPerformed.
18 years ago
and it still doesnt work.
18 years ago
u basically called me a dumbass, you have me the code. if i knew what i was doing i wouldnt have posted in the first place. thats why i posted for help. i posted expecting some awnser and used the awnser i got. to then find out you didnt add in something. im sorry i didnt look at the code, i expected the code u supplyed to work without me go looking on the forum for another way to get the code working.
i mean ok ur good at java and things, but i dont have a clue. i think you should just relax a little and think that others maybe aint quite as good as yourself.
thank you anyhow.
toothpick
18 years ago
Stored.java [54:1] <identifier> expected
public Stored(yourname)
^
Stored.java [61:1] ')' expected
private javax.swing.JTextField jTextField1;
^
2 errors
Errors compiling Stored(yourname).
18 years ago
few errors when i tryed that code. unsure why it doing it.
NameInput.java [63:1] name has private access in java.awt.Component
Stored storedFrame = new Stored(name);
^
Stored.java [57:1] cannot resolve symbol
symbol : variable yourname
location: class Stored
jTextField1.setText(yourname);
^
2 errors
Errors compiling class NameInput.
18 years ago

-------------------------------------------------------------------

------------------------------------------
18 years ago
i just dont get it.
do i still declare name as public string?
ill get code
[ April 23, 2004: Message edited by: mo robertson ]
18 years ago
don't quite understand.
18 years ago