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

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
of "How to specify button size in HTML?": ADS_TO_REPLACE_2 The <...HTML Button Size      ..._TO_REPLACE_1 The Tutorial illustrate an example from HTML Button size. In this Tutorial
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... with different size and colour. ADS_TO_REPLACE_2 HTML Button is very useful
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
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
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
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 check the size of a tar file in linux
how to check the size of a tar file in linux  Hi, I want to check the size of tar file in Linux. How to check the size of a tar file in linux? What Linux command I should use to check the size of a tar file? Thanks
How do you get the size of an array in Python
How do you get the size of an array in Python  Hi, I want to get the size of my array in Python. How do you get the size of an array in Python? How we are doing it in Python? Thanks   Hi, To find the size of any
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 to use button in array
how to use button in array  plz tell me how to code for button in array
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 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 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 reduce width of jbutton ?
how to reduce width of jbutton ?  how to reduce width of jbutton ? thanks in advancwe
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 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 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
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 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 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 display button as a link in vaadin?
How to display button as a link in vaadin?  Hello, I am working on a Vaadin based web application. I want the button to be displayed like link... a button. How to achieve this? Thanks   Hi, You can use the following code
Button
Button  How to use image for button in JSF
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 do I make an n list size in Python
How do I make an n list size in Python  Hi, I am working on a project where I have to make array of pre-defined size and fill it with zero. How do I make an n list size in Python? Thanks   Hi, I Python you can do
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
How to change image size before adding to mysql using jsp
How to change image size before adding to mysql using jsp  I want... the image size as per defined by me and then I want to store that image into my DB for example, i want to set image size 300x300. Plz help me out
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 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.ADS_TO_REPLACE_1 Draw
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
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
Size in FLex
Size in FLex  Hi..... What is the difference between width, explicitWidth, measuredMinWidth, measuredWidth, and percentWidth? please tell me about that difference Thanks
How create an overlay button on different containing div
How create an overlay button on different containing div  How to create an overlay button on different containing div
How to call java method on Button click in jsp?
How to call java method on Button click in jsp?  How to call java method on Button click in jsp
UIButton Image Size
UIButton Image Size In this example we are going to discuss about how to set image size and setting image as a UIButton background. We are doing... { [super viewDidLoad]; //Create a button UIButton *myButton = [UIButton
how to pass input from radio button to jsp page
how to pass input from radio button to jsp page  hi.. the code below...;% while(rs.next()){%> <tr> \ <td width="42...="radiobutton" /> </label></td> <td width="350">
how to pass input from radio button to jsp page
how to pass input from radio button to jsp page  hi.. the code below...;% while(rs.next()){%> <tr> \ <td width="42...="radiobutton" /> </label></td> <td width="350">
Java file get size
Java file get size In this section, you will learn how to get the size... then calls the method length() which returns the size of the file in bytes. Then we have converted the size of file from bytes to kilo bytes. Here is the code
button
button  can i give multiple commands on click of a button? if yes how can i do that?? multiple commands can we retriving dat from database, capturing data, moving to next page.. etc
button
button  can i give multiple commands on click of a button? if yes how can i do that?? multiple commands can be retriving dat from database, capturing data, moving to next page.. etc
How to Give button tool tip image
How to Give button tool tip image  In eclipse the same code is not working...not able to point to the image   Please visit the following link: Java Button Tooltip Image (adsbygoogle = window.adsbygoogle
How to design a text button.
How to design a text button.     ... of the text button, mostly we use simple buttons of circle and rectangle shape. Some places we need a text button so I made this example. New File
How to Create Button on Frame
How to Create Button on Frame       In this section, you will learn how to create Button on ... will show a simple command button labeled with the text "Submit" when
How would you create a button with rounded edges?
How would you create a button with rounded edges?   How would you create a button with rounded edges?   Hi, Here is the answer,ADS_TO_REPLACE_1 We can create rounded edge button in two way's, The first thing
Size of commarea
Size of commarea  hii, What is the size of commarea?   hello,ADS_TO_REPLACE_1 Default size of commarea is 65k
How to use radio button in jsp page
How to use radio button in jsp page       This is detailed java code how to use radio button in jsp code and display a message in another jsp page according

Ads