Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java GUI JLabel ºÍ JPanel ͼƬ ºÍ×é¼þÖصþÎÊÌâ

package ui;
import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
public class MainUi extends JPanel implements ActionListener
{
 protected JTextField id, psw;
 protected JButton ok, register, exit;
 protected JLabel idl, pswl, imgl;
 protected static JLabel imgpanel;
 protected ImageIcon image;
 public MainUi()
 {
  enableEvents(AWTEvent.WINDOW_EVENT_MASK);
  image = new ImageIcon("D://java/PZ/image/bg.jpg");
  imgpanel = new JLabel(image);
  
  id = new JTextField(60);
  id.setActionCommand("ID");
  idl = new JLabel("ID :");
  idl.setLabelFor(id);
  psw = new JTextField(60);
  psw.setActionCommand("password");
  pswl = new JLabel("PassWord: ");
  pswl.setLabelFor(psw);
  ok = new JButton("OK");
  register = new JButton("REGISTER");
  exit = new JButton("EXIT");
  JPanel login = new JPanel();
  GridBagLayout gridbag = new GridBagLayout();
  GridBagConstraints c = new GridBagConstraints();
  login.setLayout(gridbag);
//  imgl.setBounds(0, 0, imgIcon.getIconWidth(), imgIcon.getIconHeight());
//  login.setOpaque(false);
  JLabel[] labels = { idl, pswl };
  JTextField[] textFields = { id, psw };
  addLabelTextRows(labels, textFields, gridbag, login);
  c.gridw


Ïà¹ØÎĵµ£º

JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®µÄ¡°ÈýÐֵܡ± תÔØ

JAVAÖÐÓÃÓÚ´¦Àí×Ö·û´®³£ÓõÄÓÐÈý¸öÀࣺjava.lang.String¡¢java.lang.StringBuffer¡¢java.lang.StringBuilder£¬ÕâÈýÕߵĹ²Í¬Ö®´¦¶¼ÊÇfinalÀ࣬²»ÔÊÐí±»¼Ì³Ð£¬ÕâÖ÷ÒªÊÇ´ÓÐÔÄܺͰ²È«ÐÔÉÏ¿¼Âǵģ¬ÒòΪÕ⼸¸öÀ඼ÊǾ­³£±»Ê¹ÓÃ×ŵģ¬ÇÒ¿¼Âǵ½·ÀÖ¹ÆäÖеIJÎÊý±»ÐÞ¸ÄÓ°Ïìµ½ÆäËüµÄÓ¦Óá£StringBufferÓëStringBuilderÁ½¸ö»ù±¾Éϲ¶à£ ......

javaÊýÖµÀàÐÍ×Ô¶¯×ª»»Ô­Ôò

ÔÚJavaÖÐʹÓÃÊýÖµ½øÐжþÔª²Ù×÷ʱ£¬ÏÈÒª½«Á½¸ö²Ù×÷Êýת»»ÎªÍ¬Ò»ÖÖÀàÐÍ£¬×Ô¶¯×ª»»Ô­ÔòÈçÏ£º
Èç¹ûÁ½¸ö²Ù×÷ÊýÖÐÓÐÒ»¸öÊÇdoubleÀàÐ͵ģ¬ÄÇôÁíÒ»¸ö²Ù×÷Êý½«»áת»»ÎªdoubleÀàÐÍ£»
·ñÔò£¬Èç¹ûÆäÖÐÒ»¸ö²Ù×÷ÊýÊÇfloatÀàÐÍ£¬ÄÇôÁíÒ»¸ö²Ù×÷Êý½«»áת»»ÎªfloatÀàÐÍ£»
·ñÔò£¬Èç¹ûÆÚÖÐÒ»¸ö²Ù×÷ÊýÊÇlongÀàÐÍ£¬ÄÇôÁíÒ»¸ö²Ù×÷Êý½«»áת»» ......

java ö¾ÙÀà

  ö¾ÙÀàÐÍÊÇJDK5.0µÄÐÂÌØÕ÷¡£SunÒý½øÁËÒ»¸öȫеĹؼü×ÖenumÀ´¶¨ÒåÒ»¸öö¾ÙÀà¡£ÏÂÃæ¾ÍÊÇÒ»¸öµäÐÍö¾ÙÀàÐ͵Ķ¨Ò壺
¡¡¡¡Java´úÂë
¡¡¡¡public enum Color{
¡¡¡¡RED,BLUE,BLACK,YELLOW,GREEN
¡¡¡¡}
¡¡¡¡public enum Color{
¡¡¡¡RED,BLUE,BLACK,YELLOW,GREEN
     }
    ö¾ ......

JavaÏß³Ìͬ²½»úÖÆsynchronized¹Ø¼ü×ÖµÄÀí½â


JavaÏß³Ìͬ²½»úÖÆsynchronized¹Ø¼ü×ÖµÄÀí½â
¹Ø¼ü×Ö: Ïß³Ì synchronized
ÎÄÕ³ö´¦£ºhttp://tech.it168.com/j/2008-01-30/200801302324557.shtml 
×÷ÕߣºÀ´×ÔITPUBÂÛ̳ 
Ïß³Ìͬ²½£º 
¡¡¡¡ÓÉÓÚͬһ½ø³ÌµÄ¶à¸öÏ̹߳²ÏíͬһƬ´æ´¢¿Õ¼ä£¬ÔÚ´øÀ´·½±ãµÄͬʱ£¬Ò²´øÀ´ÁË·ÃÎʳåÍ»Õâ¸öÑÏÖصÄÎÊÌâ¡£JavaÓïÑÔÌṩÁË ......

¹ØÓÚjavaÖеĴ洢ÎÊÌâ


    ÐÂÊÖ¸ÐÎò……
¾Í¸öÈËÀí½â£¬javaÖзÖΪ»ù±¾Êý¾ÝÀàÐÍ»¹ÓжÔÏ󡣶ÔÓÚ»ù±¾Êý¾ÝÀàÐÍ¡£ÔÚ¸³Öµ²Ù×÷Öд«µÝµÄÊÇÖµ£¬¶ø²»ÊÇÒýÓá£ÀýÈç
int a = 10;
int b = a;
int b = 11;
Õâʱ£¬Êä³öa,b¿ÉÒÔ·¢ÏÖ¡£a = 10 ,b = 11;ÔÚb = aÕâ¸ö¸³Öµ²Ù×÷ÖУ¬Êǽ«a¶ÔÓ¦µÄÖµ´«µÝ¸øÁËb¡£¶ø²»Êǽ«bµÄÒýÓÃÖ¸ÏòÁËaµÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ