como se construye un statusbar
Como se construye una barra de estado en swing, por favor si alguien me puede ayudar, les agradecería.
Saludos.
Saludos.
package com.gui.components;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
public class JStatusBar extends JPanel {
private JLabel jLabelText = new JLabel();
private VerticalFlowLayout verticalFlowLayout1 = new VerticalFlowLayout();
private JPanel jPanel1 = new JPanel();
public JStatusBar() {
try {
jbInit();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(verticalFlowLayout1);
jPanel1.setBackground(Color.lightGray);
jPanel1.setPreferredSize(new Dimension(390, 1));
verticalFlowLayout1.setHgap(0);
verticalFlowLayout1.setVgap(0);
this.add(jPanel1, null);
this.add(jLabelText, null);
}
public void setText(String text)
{
if (text == null) text = "";
jLabelText.setText(" " + text.trim());
}
public String getText()
{
return jLabelText.getText().trim();
}
}
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
public class JStatusBar extends JPanel {
private JLabel jLabelText = new JLabel();
private VerticalFlowLayout verticalFlowLayout1 = new VerticalFlowLayout();
private JPanel jPanel1 = new JPanel();
public JStatusBar() {
try {
jbInit();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(verticalFlowLayout1);
jPanel1.setBackground(Color.lightGray);
jPanel1.setPreferredSize(new Dimension(390, 1));
verticalFlowLayout1.setHgap(0);
verticalFlowLayout1.setVgap(0);
this.add(jPanel1, null);
this.add(jLabelText, null);
}
public void setText(String text)
{
if (text == null) text = "";
jLabelText.setText(" " + text.trim());
}
public String getText()
{
return jLabelText.getText().trim();
}
}