Insert FlowLayout to BorderLayout
How Can I insert FlowLayout to BorderLayout, can somebody give me solution here is my code.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
class Frame2extends JFrame{
private JLabel label1, label2, label3, label4, label5;
Frame2(){
setLayout(new BorderLayout(5, 5));
label1 =new JLabel("Frame 2CENTER");
add(label1, BorderLayout.CENTER);
label1.setOpaque(true);
label1.setBackground(Color.RED);
label2 =new JLabel("Frame 2NORTH");
add(label2, BorderLayout.NORTH);
label3 =new JLabel("Frame 2 WEST ");
add(label3, BorderLayout.WEST);
label4 =new JLabel("Frame 2 EAST ");
add(label4, BorderLayout.EAST);
label5 =new JLabel("Frame 2 SOUTH ");
add(label5, BorderLayout.SOUTH);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setSize(360, 350);
setVisible(true);
setLocationRelativeTo(null);
}
publicstaticvoid main(String[] args)
{
Frame2 frame2 =new Frame2();
frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame2.setSize(600, 500);
frame2.setVisible(true);
}
}
I try make this but nothing happen
setLayout(new FlowLayout(BorderLayout.EAST));
label4 =new JLabel("Frame 2 EAST ");
add(label4);

