GeSHi (java):
import java.awt.Container;
import javax.swing.JFrame;
import javax.swing.JLabel;
/*--------------------------------------------------------------------------
// File and Version Information:
// Test.java
//
// Description:
// A JFrame that is centered on the screen
//
// Environment:
// This software was developed with Eclipse and Java 1.6
//
// Author List:
// deAppel <Creator>
//
//
// Copyright Information:
// Copyright (C) 2007 <Institution><None>
//
//----------------------------------------------------------------------*/
public class CenterFrame
extends JFrame{
public CenterFrame(){
setTitle("A centered JFrame");
defaultText =
new JLabel("Some text here..");
c.add(defaultText);
setSize(200,50);
setLocationRelativeTo(null);
setVisible(true);
}
public static void main
(String[] args
) { new CenterFrame();
}
}
Created by GeSHI 1.0.7.20