Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

jframe border

YourFrame.getRootPane().setBorder(
  	BorderFactory.createMatteBorder(4, 4, 4, 4, Color.RED));
Comment

how to create a border in a a jframe

.setBorder(BorderFactory.createMatteBorder(4, 4, 4, 4, Color.RED));
Comment

JFrame 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 variables in annotations 
Java :: how to convert epoch time to date in java 
Java :: counting nodes in binary search tree 
Java :: hashmap key check 
Java :: change number into array in java 
Java :: count vowels in java 
Java :: kapt plugin 
Java :: string array to string java 
Java :: bootstrap 4 modal get event related target 
Java :: jframe change icon 
Java :: java get year 
Java :: bytes to string solidity 
Java :: android studio listview arrayadapter 
Java :: how to make a copy of an array java 
Java :: simple login password and username java 
Java :: java scanner string to int 
Java :: thread 
Java :: frequency of each element from list in java 
Java :: java gridpane background color 
Java :: java restart while loop 
Java :: method returns arraylist java 
Java :: java date format with timezone 
Java :: string length in java 
Java :: jpa enum as string 
Java :: hello world java code 
Java :: how to find numbers of digits in java 
Java :: unique elements in array java 
Java :: java string array to one string 
Java :: how to get current date in java 
Java :: java string to number 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =