Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Buttons in Applets

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making an applet that is supposed to have a button in it. The only thing is I can't get the button to move from it's default position. I can have multiple buttons that cover the screen, but I just want this one little button that I can move from one set of coordinates in the applet to another. I have tried setLayout and Button.setSize(new java.awt.Dimension(x, y)); Button.setLocation(new java.awt.Point(x, y)); but for some reason neither of them work no matter what I do. Is there some simple way of setting coordinates like the type used for a drawing a rectangle?? Thank you so much in advance for any help!!
Leah
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Leah,
I tried to do the same and it is working for me.
here is the code.

regards
deekasha
 
Leah
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Deekasha!
 
Did you just should on me? You should read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic