/*
* FormUtil.java
*
* Created on 2009. oktober 21., 8:10
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package swing.form;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import javax.swing.plaf.metal.DefaultMetalTheme;
import javax.swing.plaf.metal.MetalLookAndFeel;
/**
*
* @author laci
*/
public class FormUtil {
// <editor-fold defaultstate="collapsed" desc="Konstansok">
public final static int ANCHOR_NORTH = GridBagConstraints.NORTH;
public final static int ANCHOR_NORTHEAST = GridBagConstraints.NORTHEAST;
public final static int ANCHOR_EAST = GridBagConstraints.EAST;
public final static int ANCHOR_SOUTHEAST = GridBagConstraints.SOUTHEAST;
public final static int ANCHOR_SOUTH = GridBagConstraints.SOUTH;
public final static int ANCHOR_SOUTHWEST = GridBagConstraints.SOUTHWEST;
public final static int ANCHOR_WEST = GridBagConstraints.WEST;
public final static int ANCHOR_NORTHWEST = GridBagConstraints.NORTHWEST;
public final static int ANCHOR_CENTER = GridBagConstraints.CENTER;
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="kitoltesek">
public final static int FILL_NONE = GridBagConstraints.NONE;
public final static int FILL_HORIZONTAL = GridBagConstraints.HORIZONTAL;
public final static int FILL_VERTICAL = GridBagConstraints.VERTICAL;
public final static int FILL_BOTH = GridBagConstraints.BOTH;
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="GBConsraints">
public static GridBagConstraints newGBConstraints(int gridx, int gridy, int gridw, int gridh, int anchor, int fill, Insets insets) {
return new GridBagConstraints(gridx, gridy, gridw, gridh, 0.0,0.0, anchor, fill, insets == null ? new Insets(5,5,5,5) : insets, 0, 0);
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="initLookAndFeel">
/** Be�ll�tja a form kin�zet�t */
public static void initLookAndFeel() throws Exception{
LookAndFeel lf = UIManager.getLookAndFeel();
if (lf instanceof MetalLookAndFeel) {
MetalLookAndFeel mlf = (MetalLookAndFeel)lf;
mlf.setCurrentTheme(new DefaultMetalTheme());
UIManager.setLookAndFeel(mlf);
UIManager.put("TextField.font",new Font("Arial",Font.BOLD,14));
UIManager.put("PasswordField.font",new Font("Arial",Font.BOLD,14));
}
}
// </editor-fold>
}