How to Make a Button With Java GUI - Java Programming Tricks

Saturday, July 23, 2011

way of making button with java, how to making JBUTTON with Java, gui java with button make to how, way of making button with java, making beautiful button with java, Beautiful JButton of java, way of making button at program of java, program of java make button, way of making button with java, way of making JBUTTON with GUI java, way of making button in java, tutorial of making to make to process to alter button in GUI java

With this post, I will give you source code of java that explain to you how to make a button with java, in java known as JButton, You can make JButton Easily, you can add action in button java. I'll tell you in the next post. But the first, you can use this source code to learn about how to make button with java GUI.

Hope You can understand it...

to make JButton you must make a Variable like this :

JButton (buttonname) = new JButton("Your Button Title");

maybe source code below will make you understand about it :

import javax.swing.*;
import java.awt.*;

public class mbutton {
public static void main(String[] a){
JFrame frame = new JFrame ("How to Make Button");
JButton makebutton = new JButton ("Button");
frame.getContentPane().setLayout(new FlowLayout());
frame.getContentPane().add(makebutton);
frame.pack();
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}


save that code with name "mbutton.java" and compile to be a .class file and then execute...

That will show frame like this :




Thanks for you visit us...

1 comments:

This post is very simple to read and appreciate without leaving any details out. Great work !telecom software development

Post a Comment

 
 
 
 
Copyright © Programming Tricks