How can I use setLocation() from javax.swing.JFrame on a customized JButton? I have tried to use setLayout(null); but then the button disappears!
1
Expert's answer
2013-03-05T09:20:03-0500
1.Set both prefered size and size for JFrame 2. Set both prefered size to JPanel and jbutton you add 3. frame.setLayout(null) 4. panel.setLayout(null) panel.add(myButton) frame.add(panel)
frame.setLayout(null); panel.setLayout(null);
>I have tried to use setLayout(null); but then the button disappears! This stuff happens when some element has no size set. If the element has no size, no location or even no text SWING can easily decide to not draw it at all for better optimization, seriously, no one needs sizeless empty button
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment