Forums Register Login

adding a button

+Pie Number of slices to send: Send
i've made a very small code and now i want to add a button on top of it but i don't know how . Can somebody help ?

Maybe i am missing an important concept regarding what to add where . So please point me to the right direction




+Pie Number of slices to send: Send
A JFrame has a default BorderLayout, and a BorderLayout has 6 regions, to each of which only one component can be added.
http://download.oracle.com/javase/tutorial/uiswing/layout/border.html

If you want to add the button on top of the DaDrw, first give it an appropriate layout and then add the button to it.
http://download.oracle.com/javase/tutorial/uiswing/layout/index.html

If you want to add the button and the DaDrw to the frame, use the default BorderLayout with appropriate constraints, or set a layout of your choice.
It means our mission is in jeapordy! Quick, read this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1065 times.
Similar Threads
how to highlight(change color) of the button and its neighbours when it is clicked
how to draw line between two buttons by clicking
Sorry, one more thing with AWT
Not to show the ellipse?
How to group these JLabels?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 02:43:10.