Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Swing-AWT how to increas size of button (especially width)
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


raveen
how to increas size of button (especially width)
1 Answer(s)      3 years ago
Posted in : Swing AWT


how to increas size of button (especially width)and height

Thanks in advance


Advertisement
View Answers

December 9, 2011 at 12:06 PM


Using setBounds() method, we have increased the height and width of button.

import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.awt.event.*;
import java.sql.*;
class IncreaseButtonSize extends JFrame
{
JButton b;
JLabel label;
final JTextField text;

IncreaseButtonSize(){
setLayout(null);
label = new JLabel("Name");
text = new JTextField(20);

b=new JButton("View");
label.setBounds(10,10,100,20);
text.setBounds(120,10,120,20);
b.setBounds(120,40,150,40);


add(label);
add(text);
add(b);
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae){
String value=text.getText();
JOptionPane.showMessageDialog(null,"Hello "+value);
}
});
}

public static void main(String arg[])
{

IncreaseButtonSize frame=new IncreaseButtonSize();
frame.setSize(300,120);
frame.setVisible(true);
}
}


Related Tutorials/Questions & Answers:
how to increas size of button (especially width)
how to increas size of button (especially width)  how to increas size of button (especially width)and height Thanks in advance
how to set size of button,textfield.
how to set size of button,textfield.  how we set size of button... large how to set as a preferd size in the panel or frame .when we click maximize button not effect on text or button to their of size the set on the prefered
Advertisements
HTML Button Size
HTML Button Size      ... The Tutorial illustrate an example from HTML Button size. In this Tutorial we...;html> <head> <title> Button Size <
How can we get the properties (size, type, width, height) of an image using php image functions?
How can we get the properties (size, type, width, height) of an image using php image functions?  How can we get the properties (size, type, width, height) of an image using php image functions
DOJO+Creating button of same size.
DOJO+Creating button of same size.  I am trying to create two buttons in DOJO of equal size. But the size of the buttons varies depending upon the name of the button that will get displayed. I tried by giving a class atribute
Button Size HTML
HTML Button Size can be changed according to programmer use. HTML button submits HTML page. In the following example we will learn how to change the size...;/html> Output: The following output shows two button with different size
how to set folder size in php
how to set folder size in php  hi , i know how to create folder but i dont know how to set size for folder did u know means tell me. thankyour
How to find hashtable size in Java?
How to find hashtable size in Java?  Hi, What is the code for Hashtable in Java? How to find hashtable size in Java? Give me the easy code. Thanks
how to reduce width of jbutton ?
how to reduce width of jbutton ?  how to reduce width of jbutton ? thanks in advancwe
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
how to use button in array
how to use button in array  plz tell me how to code for button in array
How to get Button Id ?
How to get Button Id ?  How to get Button ID instead of its value in Servlet. (I am not using jsp right now
How to decrease image thumbnail size in java?
How to decrease image thumbnail size in java?  Hi, I my web application I have to create the thumbnail size image from the image file uploaded by user. How to decrease image thumbnail size in java? Thanks
How a split a file into many based on size?
How a split a file into many based on size?  Consider a text file which has a size of 400 bytes, i need to split up the contents in that 400 bytes file into 100 bytes of separate files.So there should be totally 4 files should
How to Increase Upload File Size Limit in php
How to Increase Upload File Size Limit in php  Increase Upload File Size Limit for php script   Sometimes you need to upload large files. But the default file upload size settings restrict you to upload large files. PHP
how can u reduce the size of textfield?
how can u reduce the size of textfield?  how can u reduce the size of textfield? thanks in advance   import javax.swing.*; public class ReduceTextField extends JFrame { public static void main(String
how to set fetch size for jdbc odbc driver
how to set fetch size for jdbc odbc driver  What is the default fetch size for the JDBC ODBC driver and how can i fetch a set of results for JDBC... size of JDBC drivers is 10. In general default fetch size of JDBC drivers is 10
How to adjust a size of a pdf file
How to adjust a size of a pdf file       In this program we are going to tell you how we can adjust the size of a pdf file irrespective of the fact whether it exists
How to draw a web button, draw a web button, web button
How to draw a web button       Be ready to learn a simple technique to draw a web button, if you are not able to make a web button follow every steps that are give in this example
How to design a dollar button, design a dollar button, a dollar button
How to design a dollar button       Here, I am going to draw a dollar button by using this tutorial. New File: Take a new file as appropriate size. Draw a circle: Choose
How to make a button of different behaviour?
How to make a button of different behaviour?  Suppose In a jsp page I have a button SAVE with id="btnSave" value="SAVE" and a javascript function... of SAVE button will call ajaxInsertUpdateData(document.getElementByID("btnSave
how to disable browser back button
how to disable browser back button  Am doing a web application in that how to disable browser back button using java script
displaying output on web page immediately whent the jsp buffer size is full. And how to set jsp buffer size in bytes
displaying output on web page immediately whent the jsp buffer size is full. And how to set jsp buffer size in bytes  Here is my requirement, I... jsp buffer size in byte instead of kb. I have tried like this, <%@ page
How to Create Button With TableView in iphone
How to Create Button With TableView in iphone  My requirement is i am creating one button. when i press the button TableView will display... on the button can u please send me the code i want to create converter app. thanks
How to set UILabel text size, color etc.. in XCode
How to set UILabel text size, color etc.. in XCode  How to set UILabel text size (height), color etc.. in XCode
How to create a zip file and how to compare zip size with normal text file
How to create a zip file and how to compare zip size with normal text file  Hi, how are you?I hope you are fine.I want program like how to create zip... in program or is there any diff procedure like checking the size especially
How to make animated web button, make animated web button, animated web button
How to make animated web button       This is a web button animation example, it is a very simple... take a new file as button size. Draw a circle: Choose "f253f4" color
How to restrict the number of message driven size in EJB pool - EJB
How to restrict the number of message driven size in EJB pool  Hi Team, I am new to JMS, I have successfully deployed and run the message driven bean in JBOSS, but I have one task that number of message driven beans should
Button
Button  How to use image for button in JSF
How to find the size of a dynamic webpage using java... eg : Youtube........
How to find the size of a dynamic webpage using java... eg : Youtube... into a StringBuilder object * and prints it out to console along with the * size...()); System.out.println("The size of the web page is " + builder.length
 

 

 

DMCA.com