Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

setbounds in java

setBounds(int x-coordinate, int y-coordinate, int width, int height)
Comment

swing setbounds

import javax.swing.*;    
public class button {  
public static void main(String[] args) {  

JFrame frame = new JFrame;
frame.setSize(400, 400);
frame.setVisible(true);
frame.setLayout(null);
  
  //create button
  
JButton btn = new JButton("ok");
btn.setBounds(150, 200, 50, 50); // Properties of button, size, x, and y.
  
  //append button to frame
  
frame.add(btn);

}}
Comment

PREVIOUS NEXT
Code Example
Java :: toCharArray() method java 
Java :: inorder, PreOrder, PostOrder java 
Java :: How to remove backstack fragment 
Java :: bootstrap 4 modal get event related target 
Java :: empty array java 
Java :: java restart program 
Java :: java flowlayout 
Java :: calculator with java 
Java :: regex pattern for date validation 
Java :: android studio listview arrayadapter 
Java :: nested for each loop java 
Java :: java random number between 2 values inclusive 
Java :: java get date in utc 
Java :: android list index 
Java :: java triangle 
Java :: how to solve Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. 
Java :: how to read file from console in java 
Java :: java exception message 
Java :: java dynamic method dispatch 
Java :: java check if number is in range 
Java :: array to list java 
Java :: java date minus 1 day 
Java :: java how to convert string to int 
Java :: java read next line 
Java :: java for each loop 
Java :: fill two dimensional array 
Java :: javafx main class 
Java :: javac clear 
Java :: okhttp3 library in android studio 
Java :: car class java 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =