+ 1

Is any body know how to create a button by coding in java....????

i want to create tools using codes...somebody plz help me......(ex:-buttons,checkboxes,radio buttons)

10th Jul 2017, 11:21 AM
Madusha Gunawardana
Madusha Gunawardana - avatar
2 Answers
0
import.java.swing.*; public class swingdemo{ public static void main(String args[]){ JFrame frame=new JFrame("name"); JPanel p=new JPanel(null); frame.add(p); JButton btn1=new JButton("name"); btn1.setBounds(130,100,100,100); //(x,y,width,height) of the button p.add(btn1); frame.setSize(500,500); frame.setVisible(true); } } button eka obana seen ekath oneda???
11th Jul 2017, 6:28 AM
naveen Avishka
naveen Avishka - avatar