Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java swing 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 local function 
Java :: how to recognize a pressed key in java 
Java :: map.keyset 
Java :: array de meses java 
Java :: Explain try & catch finally block in Java 
Java :: mettre caractère de string en majuscule java 
Java :: split in java 
Java :: 9999999999999 
Java :: android press back 2 times to exit 
Java :: Bukkit plugin player variable 
Java :: HashMap to store key and value pair. 
Java :: all possible substrings of a string java of specific length 
Java :: java enum strings 
Java :: java programme for fibonnaci series 
Java :: new in t arrray java 
Java :: Could not resolve project :app 
Java :: jda documentation discord 
Java :: how to create a node in java 
Java :: java check if string appears twice in arraylist 
Java :: string vs new string 
Java :: observer design pattern 
Java :: limit decimals java 
Java :: java garbage collection 
Java :: get string size 
Java :: single level inheritance in java 
Java :: java design patterns 
Java :: java first index of an arraylist 
Java :: how to divide a double in java 
Java :: java pass by reference 
Java :: deep content 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =