1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;
public class named extends JFrame
{
private final JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
try
{
named frame = new named();
frame.setVisible(true);
} catch (Exception e)
{
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public named()
{
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
contentPane.setBackground(Color.BLUE);
JPanel MenuLeft = new JPanel();
MenuLeft.setLayout(new FlowLayout());
MenuLeft.setBackground(Color.BLUE);
contentPane.add(MenuLeft);
FlatButton b1 = new FlatButton("Mon parc");
FlatButton b2 = new FlatButton("Mes véhicules");
FlatButton b3 = new FlatButton("Mes clients");
b1.setFont(new Font("Montserrat",Font.ROMAN_BASELINE, 20));
//b1.setBackground(new Color(0x4773B9));
b1.setForeground(new Color(255,255,255));
b1.setPreferredSize(new Dimension(175,50));
b1.setHorizontalAlignment(SwingConstants.CENTER);
b1.setVerticalAlignment(SwingConstants.CENTER);
MenuLeft.add(b1);
b2.setFont(new Font("Montserrat",Font.ROMAN_BASELINE, 20));
//b2.setBackground(new Color(0x4773B9));
b2.setForeground(new Color(255,255,255));
b2.setPreferredSize(new Dimension(175,50));
b2.setHorizontalAlignment(SwingConstants.CENTER);
b2.setVerticalAlignment(SwingConstants.CENTER);
MenuLeft.add(b2);
b3.setFont(new Font("Montserrat",Font.ROMAN_BASELINE, 20));
b3.setForeground(new Color(255,255,255));
b3.setPreferredSize(new Dimension(175,50));
b3.setHorizontalAlignment(SwingConstants.CENTER);
b3.setVerticalAlignment(SwingConstants.CENTER);
MenuLeft.add(b3);
}
} |
Partager