Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

JFrame change border

import java.awt.*;
import javax.swing.*;

public class BorderFrameExample extends JFrame 
{
   JLabel l = new JLabel("Welcome!", JLabel.CENTER);
   
   public BorderFrameExample() {
      //add label to frame
      add(l, BorderLayout.CENTER);
      //remove the decoration
      setUndecorated(true);
      //set border
      getRootPane().setBorder(
         BorderFactory.createMatteBorder(4, 4, 4, 4, Color.BLUE)
      );
      setSize(250,250);
      setVisible(true);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   }
   public static void main(String[] args) {
      new BorderFrameExample();
   }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java swing border 
Java :: hashmap put 
Java :: java inner method 
Java :: current port used by the Java application 
Java :: what is a cache-less reload 
Java :: java string stringbuilder array list tostring 
Java :: java exponencial 
Java :: area of rectangle in java 
Java :: difference between linkedlist and arraylist 
Java :: inheritance in java 
Java :: java clear scanner 
Java :: javaparser 
Java :: return random boolean 
Java :: hbox layout javafx 
Java :: null java 
Java :: how to reverse numbers in java 
Java :: arrondi java 
Java :: polymorphism in java 
Java :: regex java 
Java :: kotlin spinner default value 
Java :: java check prime number 
Java :: string to char array 
Java :: java to c# converter 
Java :: fill array with random numbers 
Java :: convert string into unicode java 
Java :: the java_home environment variable is not defined correctly on mac 
Java :: math.pow(x2-x1,2) 
Java :: swap two nodes of a linked list 
Java :: how to encrypt password in properties file in spring boot 
Java :: " meaning in java 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =