import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.plaf.metal.*;
import javax.swing.plaf.metal.*;
public class xxo
{
public static JPanel pane(String xtitle)
{
JPanel pane = new JPanel();
TitledBorder title;
title = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.green, Color.green),
xtitle,
TitledBorder.LEADING,
TitledBorder.TOP,
new Font("Serif", Font.PLAIN, 14),
Color.green);
pane.setBorder(title);
pane.setBackground(Color.black);
pane.setForeground(Color.green);
pane.setOpaque(true);
return pane;
}
public static JCheckBox jcb(String xtitle, int r, int s, int t, int u)
{
//UIManager.put("JCheckBox.selected", Color.green);
//UIManager.put("JCheckBox.interiorForeground", Color.green);
//this.setVisible(true);
JCheckBox a1 = new JCheckBox(xtitle, new CheckBoxIcon());
a1.setSelected(true);
a1.setBorder(BorderFactory.createEmptyBorder(r, s, t, u));
a1.setBackground(Color.black);
a1.setForeground(Color.green);
a1.setOpaque(true);
return a1;
}
public static JLabel fnummberkey(String fkey)
{
JLabel f1;
f1 = new JLabel(fkey);
f1.setBackground(Color.black);
f1.setForeground(Color.green);
return f1;
}
public static JComboBox fcheat()
{
String[] cheats = {" ", "666", "999"};
JComboBox f1list = new JComboBox(cheats);
f1list.setEditable(true);
ComboBoxRenderer renderer = new ComboBoxRenderer();
//renderer.setPreferredSize(new Dimension(200, 130));
f1list.setRenderer(renderer);
// now a bug
f1list.setPreferredSize(new Dimension(229, 20));
//piclist.setAlignmentX(Component.LEFT_ALIGNMENT);
//piclist.addActionListener(this);
f1list.setBackground(Color.black);
f1list.setForeground(Color.green);
return f1list;
}
public static JButton fButton(String bt)
{
JButton F1Button = new JButton(bt);
F1Button.setBackground(Color.black);
F1Button.setForeground(Color.green);
//http://java.sun.com/docs/books/tutorial/uiswing/components/border.html thx to Yannix(forum.java.sun.com)
F1Button.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createLineBorder(Color.green),
BorderFactory.createEmptyBorder(5,5,5,5)
));
return F1Button;
}
public static class ComboBoxRenderer extends JLabel implements ListCellRenderer
{
public ComboBoxRenderer()
{
setOpaque(true);
}
public Component getListCellRendererComponent(
JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
{
list.setForeground(Color.green);
list.setBackground(Color.black);
return this;
}
}
//now tick of checkbox
private static class CheckBoxIcon implements Icon/*, Serializable*/
{
final static int csize = 13;
public void paintIcon(Component c, Graphics g, int x, int y)
{
JCheckBox cb = (JCheckBox) c;
ButtonModel model = cb.getModel();
// outer bevel
if( !cb.isBorderPaintedFlat() )
{
// Outer top/left
g.setColor(Color.green);
g.drawLine(x, y, x+11, y);
g.drawLine(x, y+1, x, y+11);
// Outer bottom/right
g.setColor(Color.green);
g.drawLine(x+12, y, x+12, y+12);
g.drawLine(x, y+12, x+11, y+12);
// Inner top.left
g.setColor(Color.green);
g.drawLine(x+1, y+1, x+10, y+1);
g.drawLine(x+1, y+2, x+1, y+10);
// Inner bottom/right
g.setColor(Color.green);
g.drawLine(x+1, y+11, x+11, y+11);
g.drawLine(x+11, y+1, x+11, y+10);
// inside box
if( (model.isPressed() && model.isArmed()) || !model.isEnabled() )
{
g.setColor(Color.black);
}
else
{
g.setColor(Color.black);
}
g.fillRect(x+2, y+2, csize-4, csize-4);
}
else
{
g.setColor(Color.green);
g.drawRect(x+1, y+1, csize-3, csize-3);
if( (model.isPressed() && model.isArmed()) || !model.isEnabled() )
{
g.setColor(Color.green);
}
else
{
g.setColor(Color.green);
}
g.fillRect(x+2, y+2, csize-4, csize-4);
}
if( model.isEnabled() )
{
g.setColor(Color.green);
}
else
{
g.setColor(Color.green);
}
// paint check
if( model.isSelected() )
{
g.drawLine(x+9, y+3, x+9, y+3);
g.drawLine(x+8, y+4, x+9, y+4);
g.drawLine(x+7, y+5, x+9, y+5);
g.drawLine(x+6, y+6, x+8, y+6);
g.drawLine(x+3, y+7, x+7, y+7);
g.drawLine(x+4, y+8, x+6, y+8);
g.drawLine(x+5, y+9, x+5, y+9);
g.drawLine(x+3, y+5, x+3, y+5);
g.drawLine(x+3, y+6, x+4, y+6);
}
}
public int getIconWidth()
{
return(csize);
}
public int getIconHeight()
{
return(csize);
}
}
}