• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

How to Add setbounds inside static void main in java  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making an application in java, inside static void main, i want to customize all buttons, text areas and want to put them on desired location inside application. I have tried to use setbounds but can not use it, how can i use it, or is there any other way or layout to make my application components customized layout.
 
Marshal
Posts: 64493
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I shall move this discussion to our GUIs forum.
You should not be doing anything like that inside the main method. The main method should simply start your application; in the case of a Swing application it would simply start the event dispatch thread.
You should probably not use setBounds on anything other than your top‑level container. You should use a layout, which you can read about in the Java Tutorials, and allow the layout to position your components. That way they retain their appearance if you resize the display.
You might do well to search for a tutorial about MigLayout. I haven't used it, but the people who have all speak well of it.
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!