Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Java Help

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-08-2008, 08:38 PM
DivideByZero DivideByZero is offline
Newbie
 
Join Date: Dec 2007
Posts: 24
Rep Power: 3
DivideByZero is on a distinguished road
Default threads and panels?

How can I use threads and panels?

"public class ThreadProg extends Thread"

"public class ThreadProg extends Panel"

How can I combine it?


these don't work:
public class ThreadProg extends Thread, Panel
public class ThreadProg extends Thread extends Panel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 05-17-2008, 03:57 PM
acwclassic's Avatar   
acwclassic acwclassic is offline
Newbie
 
Join Date: Mar 2008
Location: sweden
Posts: 16
Rep Power: 2
acwclassic is on a distinguished road
Default Re: threads and panels?

donno how to solve it, but java only permits a class to inherit one thing.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-18-2008, 12:56 PM
Arkie Arkie is offline
Learning Programmer
 
Join Date: Dec 2007
Posts: 70
Rep Power: 3
Arkie is on a distinguished road
Send a message via MSN to Arkie
Default Re: threads and panels?

you could use runnable like i do working with gui's I suppose i could write a demo when i have some time later today.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-21-2008, 07:06 PM
reniery reniery is offline
Newbie
 
Join Date: May 2008
Posts: 19
Rep Power: 1
reniery is on a distinguished road
Default Re: threads and panels?

You could use the following

public class ThreadProg extends Panel implements Thread

implements doesnt mean the same as extends but in some cases its very useful
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-22-2008, 09:31 AM
acwclassic's Avatar   
acwclassic acwclassic is offline
Newbie
 
Join Date: Mar 2008
Location: sweden
Posts: 16
Rep Power: 2
acwclassic is on a distinguished road
Default Re: threads and panels?

as reniery said it works about the same. when you extend it mean you can use the functions direcly. when you implement you need to have the functions in your class (and you need all of them even the ones you dont use, but you can leave them empthy).
another way could be to use an inner class. the class can reach all the methods in your inner class.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 02:08 AM.

Contest Stats

dargueta ........ 128.00000
John ........ 127.00000
Xav ........ 107.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

Ads