Hi friends,I got a problem down here..
Ok here's part of my First GUI code. all I want to do is locate the labelImage
on the bottom half of the panel
.. any idea..?
I tried the following steps.but it didn't help
Set the container's layout manager to null by calling setLayout(null).
Call the Component class's setbounds method for each of the container's children.
Call the Component class's repaint method.
thank you..
code
public void GUI4(){
JFrame frame = new JFrame("GIS ");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ImageIcon image = new ImageIcon("C:/icon.jpg");
ImageIcon logo = new ImageIcon("C:/Earth.gif");
JLabel label = new JLabel(image);
JLabel labelImage = new JLabel(logo);
built = new JButton("show built information");
environment = new JButton("show environment information");
road = new JButton("show Road network");
traffic = new JButton("show Traffic Sensors");
JPanel panel = new JPanel();
panel.add(built);
panel.add(environment);
panel.add(road);
panel.add(traffic);
panel.add(labelImage);
label.setPreferredSize(new Dimension(1200, 1000));
Image img =new Image(image);
JScrollPane jScrollPane = new JScrollPane(img);
img.fechtData(roads1,roads2,envir,builtIn);
frame.add(jScrollPane, BorderLayout.CENTER);
//frame.setResizable(false);
panel.setBackground(Color.cyan);
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
frame.getContentPane().add(BorderLayout.EAST,panel);
frame.setSize(1500, 700);
// frame.pack();
frame.setVisible(true);
}