Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java add button

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 :: support different screen sizes android 
Java :: java make all interfaces implement another 
Java :: remove fragment from backstack 
Java :: check have string have just numbers 
Java :: java main method 
Java :: java arithmetic operators 
Java :: android studio change title bar text 
Java :: how to get int from string java 
Java :: java logger 
Java :: android studio constraint layout proportional height 
Java :: range in java 
Java :: how to summon lightning in minecraft 
Java :: difference between access specifiers and access modifiers in java 
Java :: android list[i] 
Java :: Caused by: java.lang.RuntimeException: No installed build tools found. Install the Android build tools version 19.1.0 or higher. 
Java :: lambda comparator java 
Java :: java gridpane background color 
Java :: convert arraylist to csv file java 
Java :: java empty array 
Java :: break java 
Java :: setting scale to big decimal java 
Java :: Java Create a ConcurrentHashMap 
Java :: radio button java swing 
Java :: intent pick action video android 
Java :: how to add element to end of array java 
Java :: fill two dimensional array columns by columns java 
Java :: Java Create ArrayList in Java 
Java :: intent android 
Java :: send data from service to activity class 
Java :: java array add element 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =