*
The moose likes Swing / AWT / SWT and the fly likes combining controls and graphics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "combining controls and graphics" Watch "combining controls and graphics" New topic
Author

combining controls and graphics

Nirmal JeyaChandra
Greenhorn

Joined: Aug 31, 2005
Posts: 25
How to combine controls and graphics in JApplet it is not working. Controls is not visible.

It works in java.applet but not properly when combined with threads.

Thanks in advance.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

What are you doing, exactly, that's not working?


[Jess in Action][AskingGoodQuestions]
Nirmal JeyaChandra
Greenhorn

Joined: Aug 31, 2005
Posts: 25

This is my program

[ UD: added CODE tags ]
[ January 09, 2006: Message edited by: Ulf Dittmer ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
The JPanel "p" is never added to the GUI, so it -and everything it contains- won't be drawn.

I have added code tags to your post, which keep code much more readable. Next time you post code, please use them as well - they're accessible through the "CODE" button beneath the text entry field when you post.


Ping & DNS - my free Android networking tools app
Nirmal JeyaChandra
Greenhorn

Joined: Aug 31, 2005
Posts: 25
How to add separate panel for drawing lines and separate panel for controls like buttons.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
This seems more of a Swing question than an applet question, so I'm moving this to our GUI forum. Please continue the discussion there.
[ January 09, 2006: Message edited by: Ulf Dittmer ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: combining controls and graphics
 
Similar Threads
adding controls to JFrame
WA #1.....word association
Is there any canvas like component in JSF?
Correct this code for event handling.
Mixing Android GUI controls with game graphics