Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

How to move Button

$
0
0
How can I move a button through using the x and y axis?
Also the size it always shows a a big button.
I used setsize and setbounds but it didnt work.

import java.awt.Image;
import javax.swing.JButton;
import javax.swing.JFrame;


public class optionButton extends JFrame {

public JButton shop;
public JButton exit;
public Image leftButtonIcon;
public Image bg;

public optionButton(){
	shop = new JButton("ROD");

	
	shop.setBounds(0, 0, 100, 200);
	shop.setSize(123,123);
	add(shop);
	
	}

public static void main(String[] args) {
	optionButton o= new optionButton();
	o.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	o.setSize(700, 700);
	o.setVisible(true);
}

}

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>