Java Swing LayoutManager
BorderLayout
FlowLayout
GridLayout
GridBagLayout
CardLayout
BoxLayout
< type="text/javascript">
document.body.oncopy = function() {
if (window.clipboardData) {
setTimeout(function() {
var text = clipboardData.getData("text");
if (text && text.length > 300) {
text = text + "\r\n\n±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£º" + location.href;
clipboardData.setData("text", text);
}
}, 100);
}
}
BorderLayout
FlowLayout
GridLayout
GridBagLayout
CardLayout
BoxLayout
1.BorderLayout
java.lang.Object
--java.awt.BorderLayout
½«°æÃæ»®·Ö³É¶«¡¢Î÷¡¢ÄÏ¡¢±±¡¢ÖÐÎå¸öÇøÓò£¬½«Ìí¼ÓµÄ×é¼þ°´Ö¸¶¨Î»Ö÷ÅÖá£
BorderLayout.EAST
BorderLayout.WEST
BorderLayout.SOUTH
BorderLayout.NORTH
BorderLayout.CENTER
¹¹Ô캯Êý£º
BorderLayout()
½¨Á¢×é¼þ¼äÎÞ¼ä¾àµÄBorderLayout
BorderLayout(int hgap,int vgap)
½¨Á¢×é¼þ¼äˮƽ¼ä¾àΪhgap,´¹Ö±¼ä¾àΪvgapµÄBorderLayout
ÀýÒ»£º
view plain
copy to clipboard
print
?
import
java.awt.BorderLayout;
import
javax.swing.JFrame;
import
javax.swing.JButton;
/**
*
* @author Chel
*/
public
class
BorderLayoutDemo {
public
static
void
main(String[] args) {
//½¨Á¢Ò»¸öJFrame,JFrameµÄĬÈÏLayoutManagerΪB
Ïà¹ØÎĵµ£º
Object Ordering
A List l may be sorted as follows.
Collections.sort(l);
If the List consists of String elements, it will be sorted into alphabetical order. If it consists of Date elements, it will be sorted into chronological order. How does this happen? String and Date both implement the Compara ......
BODY { color: #000000; font-size: 9pt; font-family: ËÎÌå }
TABLE { font-size: 9pt; font-family: ËÎÌå }
SimpleDateFormat sdfy = new SimpleDateFormat("HH:mm");
String tt =
"Tue Feb 09 10:43:00 CST 2010";
&n ......
Ò»¡¢java.util.Formatter
java.util.Formatter ÊÇJDK1.5ÐÂÔöµÄÀà¿â£¬¹¦ÄܺÜÇ¿´ó£¬µ«ÊDz»ºÃÕÆÎÕ£¬¾ÍÏñÏÂÆåÒ»Ñù£¬ÖªµÀÈçºÎ×߯å×Ó£¬ºÍÊìÁ·Ó¦ÓÃÍêÈ«ÊÇÁ½ÂëÊ¡£
¸ñʽ»¯Ö÷ÒªÓÃÔÚÎı¾Êä³ö·½Ã棬±ÈÈ磬Êý×Ö¡¢ÈÕÆÚ¡¢½ð¶îµÈ£¬»¹ÓÐÀàËÆ³¬ÊеĹºÎﵥСƱµÈµÈ£¬¶¼»áÓõ½¸ñʽ»¯Êä³öµÄ¹¤¾ß¡£ÔÚ´ËÀàû³öÏÖ֮ǰ£¬Ö»ÄÜͨ¹ý¿ ......
¿ÉÒÔÓÃ×öcsdn±¸·Ý£¬Õâ¸ö·½·¨À©³äÒÔºó×ö¸öcsdn±¸·Ý¹¤¾ßµ¹ÊDz»´í
package com.tag;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import ja ......