This discussion is closed.
AT82
Badges: 0
Rep:
?
#1
Report Thread starter 16 years ago
#1
I know this is a very basic question, just started my Java assignment and am very out of practise.

How do you destroy an object i.e a button

i.e

Code:
Button startbut=new Button("Start Game");
			add (startbut);
	}
	public void actionPerformed(ActionEvent e)
	{
		//destroy button here
	}
0
Mr White
Badges: 0
Rep:
?
#2
Report 16 years ago
#2
(Original post by amazingtrade)
I know this is a very basic question...
*hideously confused*

Wha?
0
kindersurprise
Badges: 0
Rep:
?
#3
Report 16 years ago
#3
(Original post by amazingtrade)
I know this is a very basic question,
Yes, very basic..... :rolleyes:
What the hell?
xox
0
LH
Badges: 15
Rep:
?
#4
Report 16 years ago
#4
Can't you just press delete?
0
AT82
Badges: 0
Rep:
?
#5
Report Thread starter 16 years ago
#5
(Original post by piginapoke)
The only way to destroy an Object in Java is to set it to null; then the garbage collector may or may not release the memory. Unless you're talking about removing it from the display, in which case you'll have to do startbut.setVisible(false);
Thanks, yeah that will be fine, I just want to hide away from the screen basicaly.

I find all this OO stuff so confusing!

Kingasuprise and Mr White - Exactly I don't really understand it either!
0
Mr White
Badges: 0
Rep:
?
#6
Report 16 years ago
#6
(Original post by Lord Huntroyde)
Can't you just press delete?
No, that would be much too easy.
0
me!
Badges: 8
Rep:
?
#7
Report 16 years ago
#7
When in doubt dance!

(Sorry for this non constructive (in a conformed sense) post)
0
AT82
Badges: 0
Rep:
?
#8
Report Thread starter 16 years ago
#8
(Original post by me!)
When in doubt dance!

(Sorry for this non constructive (in a conformed sense) post)
So I am so am I, I've left this assignment till late because I've been dreading it, nothing seems to work.

I'll be lukcy to get a 3rd in this assignment. I thought I was quite good at programming as well.
0
Nylex
Badges: 10
Rep:
?
#9
Report 16 years ago
#9
(Original post by amazingtrade)
I find all this OO stuff so confusing!
I find event handling confusing.
0
kindersurprise
Badges: 0
Rep:
?
#10
Report 16 years ago
#10
(Original post by Nylex)
I find event handling confusing.
I dont even know what handling is lol
xox
0
....
Badges: 1
Rep:
?
#11
Report 16 years ago
#11
(Original post by kindersurprise)
I dont even know what handling is lol
xox
I can show you. :eek:
0
Nylex
Badges: 10
Rep:
?
#12
Report 16 years ago
#12
(Original post by kindersurprise)
I dont even know what handling is lol
xox
Events are things like keystrokes, pressing a button, mouse clicks.
Event handling is responding to those things in a program, ie. code that does certain things when a certain button is pressed, etc.
0
Chris_
Badges: 0
Rep:
?
#13
Report 16 years ago
#13
(Original post by amazingtrade)
I know this is a very basic question, just started my Java assignment and am very out of practise.
I dont mean to be negative, or to put you on a downer, but this should be very easy for a 3rd year computing student. What languages did you learn in your first and second years?
0
AT82
Badges: 0
Rep:
?
#14
Report Thread starter 16 years ago
#14
(Original post by Chris_)
I dont mean to be negative, or to put you on a downer, but this should be very easy for a 3rd year computing student. What languages did you learn in your first and second years?
I'm a second year student and not strictly a computing student I'm doing Multimedia and Internet Technology, most the programming langauges have been taught this year. Until this module I've never seen the object oriented model before.

So for I've done
ASP
PHP
VB6
C
Java (this module)
and other simple langauges such as HTML, CSS, Lingo and Actionscript

The modules I did last year were more about broadcast technologies (i.e TV), video production, MIDI, synthesis and VB.

Next year I do .NET, C++ in depth sound/video production, more advanced graphics design etc.

P.S Piginapoke the set vistible false thing works fine thanks
0
Chris_
Badges: 0
Rep:
?
#15
Report 16 years ago
#15
OK, sorry, I thought you were just on a straight computing degree.
0
Rich
Badges: 2
Rep:
?
#16
Report 16 years ago
#16
We so need a computing subforum.
0
MattG
Badges: 1
Rep:
?
#17
Report 16 years ago
#17
(Original post by rahaydenuk)
We so need a computing subforum.
i dread to think.......*imagines quake 3 t-shirts and yoda backpacks*
0
Rich
Badges: 2
Rep:
?
#18
Report 16 years ago
#18
(Original post by piginapoke)
Absolutely. I rarely check the academia forum (as I know about little else), and this question would have eluded me if it was posted in there.
I'll see what I can do.
0
AT82
Badges: 0
Rep:
?
#19
Report Thread starter 16 years ago
#19
A computing subsection would be very handy. The only problem is I can see it been populated with:

"my msn aint workin' and i dowload a mp3 file caled ganstarap.mp3.exe and ths has f*cking my compotuer up, wotz wrong with dit?"

Perhaps it would be good if there was a PC related subforum and a programming one.
0
Chris_
Badges: 0
Rep:
?
#20
Report 16 years ago
#20
(Original post by amazingtrade)
Perhaps it would be good if there was a PC related subforum and a programming one.
I was thinking of something along these lines aswell, but a programming sub-forum would be quite specialised, so it wouldn't be used by many people, and so probably isn't justified.
0
X
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Have you made your firm and insurance uni choices yet?

Yes (68)
52.71%
Yes, but I want to swap them (10)
7.75%
No, but I know who I want to choose (14)
10.85%
No, I still don't know who I want to choose (33)
25.58%
I have decided I don't want to go to uni anymore and will not be choosing (4)
3.1%

Watched Threads

View All