LAB 5(4 tiết): Sử dụng sự kiện chuột và bàn phím

Size: px
Start display at page:

Download "LAB 5(4 tiết): Sử dụng sự kiện chuột và bàn phím"

Transcription

1 THỰC HÀNH CÔNG CỤ VÀ MÔI TRƯỜNG VÀ LẬP TRÌNH TS. Võ Phương Bình binhvp@dlu.edu.vn Information Technology Faculty - Dalat University Website: LAB 5(4 tiết): Sử dụng sự kiện chuột và bàn phím A. Mục tiêu: - Hiểu biết và sử dụng được các sự kiện chuột và bàn phím - Xử lý các sự kiện trên môi trường GUI B. Kết quả sau khi hoàn thành: - Sử dụng được các thành phần thiết kế để có thể tạo ra các giao diện. - Xây dựng các ứng dụng có sự kiện chuột và bàn phím. - Nhúng vào website tự thiết kế đơn giản. C. Luyện tập: Quy tắc sử dụng sự kiện: Khai báo kế thừa interface phù hợp với sự kiện cần xử lý. Phải định nghĩa lại tất cả các phương thức của interface được kế thừa. Ví dụ: 1. Cần xử lý các sự kiện ActionEvent như click trên Button, Menu thì kế thừa interface ActionListener. Ta phải khai báo phương thức actionperformed(actionevent e). 2. Cần xử lý về sự kiện chuột thì kế thừa interface MouseListener. Ta phải định nghĩa các phương thức sau: public void mousepressed(mouseevent evt); public void mousereleased(mouseevent evt); public void mouseclicked(mouseevent evt); public void mouseentered(mouseevent evt); public void mouseexited(mouseevent evt); D. Bài tập. Bài 1: Hãy viết chương trình xử lý sự kiện choṇ ma u va nhâ p pha i chuột ve hi nh chư nhâ t như minh họa sau:

2 Hươ ng dâñ: import java.awt.*; import java.awt.event.*; import javax.swing.*; class RainbowPalette extends JPanel implements MouseListener { /* The currently selected color is stored in the variable selectedcolor. The hue of this color -- a float value in the range 0.0F to 1.0F is stored in selectedhue. The value of selectedhue is used to determine where to draw the hilite on the palette */ private float selectedhue = 0; private Color selectedcolor = Color.getHSBColor(0,1,1);

3 RainbowPalette() { // Constructor. Set the component to listen for mouse clicks // on itself, and set the preferred size. The gray background // color will show around the edges of the colored palette. addmouselistener(this); setpreferredsize( new Dimension(256, 24) ); setbackground(color.gray); public Color getselectedcolor() { // Return the color that is currently selected in the palette. return selectedcolor; public void paintcomponent(graphics g) { // Draw the palette, and add a white rectangle to hilite // the selected color. super.paintcomponent(g); int width = getwidth(); int height = getheight(); for (int i = 0; i < width - 8; i++) { float hue = (float)i / (width-8); g.setcolor( Color.getHSBColor(hue, 1, 1) );

4 g.drawline(i+4,4,i+4,height-5); int x = 4 + (int)(selectedhue*(width-8)); // x-coord of selected color. g.setcolor(color.white); g.drawrect(x-2,3,2,height-7); // Draw the hilite. g.drawrect(x-3,2,4,height-5); public void mousepressed(mouseevent evt) { // When the user clicks on the component, select the // color that the user clicked. But make sure that // the selectedhue is in the legal range, 0 to 1. int x = evt.getx(); selectedhue = (float)x / (getsize().width - 4); if (selectedhue < 0) selectedhue = 0; else if (selectedhue > 1) selectedhue = 1; selectedcolor = Color.getHSBColor(selectedHue, 1, 1); repaint(); public void mousereleased(mouseevent evt) {

5 public void mouseclicked(mouseevent evt) { public void mouseentered(mouseevent evt) { public void mouseexited(mouseevent evt) { // end class RainbowPalette import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.arraylist; public class SimpleDrawRects extends JFrame { RainbowPalette colorinput; // A palette of colors that appears // at the bottom of the applet. The // RainbowPalette class is non-standard, // and is defined externally to this file. public SimpleDrawRects() { // Set up the applet with a drawing surface and palette. setbackground(color.black); // shows along border

6 Rects canvas = new Rects(); colorinput = new RainbowPalette(); getcontentpane().add(canvas, BorderLayout.CENTER); getcontentpane().add(colorinput, BorderLayout.SOUTH); public Insets getinsets() { // Leave space for a black border around the applet. return new Insets(2,2,2,2); // Nested classes static class ColoredRect { // Represents the data for one colored rectangle. int x, y, width, height; // Location and size of rect. Color color; // Color of rect. class Rects extends JPanel implements MouseListener, MouseMotionListener {

7 // This class is a canvas that shows some colored rectangles. // The user adds a rectangle by right-clicking on the canvas. // The user can delete a rectangle by Alt-clicking it, and can // move it out in front of the other rectangles by Shift-clicking // it. The user can also click-and-drag rectangles to move them // around the canvas. private ArrayList rects; // The colored rectangles are represented by objects // of type ColoredRect that are stored in this ArrayList. /* Variables for implementing dragging. */ private boolean dragging; // This is true when dragging is in progress. private ColoredRect dragrect; // The rect that is being dragged (if dragging is true). private int offsetx, offsety; // The distance from the upper left corner of the // dragrect to the point where the user clicked // the rect. This offset is maintained as the // rect is dragged. Rects() {

8 // Constructor. The canvas listens for mouse events, and an // ArrayList is created to hold the ColoredRects. setbackground(color.white); addmouselistener(this); addmousemotionlistener(this); rects = new ArrayList(); ColoredRect findrect(int x, int y) { // Find the topmost rect that contains the point (x,y). // Return null if no rect contains that point. // The rects in the ArrayList are considered in reverse order // so that if one lies on top of another, the one on top // is seen first and is returned. for (int i = rects.size() - 1; i >= 0; i--) { ColoredRect rect = (ColoredRect)rects.get(i); if ( x >= rect.x && x < rect.x + rect.width && y >= rect.y && y < rect.y + rect.height ) return rect; // (x,y) is inside this rect. return null;

9 void bringtofront(coloredrect rect) { // If rect!= null, move it out in front of the other // rects by moving it to the last position in the ArrayList. if (rect!= null) { rects.remove(rect); // Remove rect from current position. rects.add(rect); // Put rect in the ArrayList in last position. repaint(); void deleterect(coloredrect rect) { // If rect!= null, remove it from the ArrayList and from the screen. if (rect!= null) { rects.remove(rect); repaint(); public void paintcomponent(graphics g) { // Draw all the rects in the ArrayList. super.paintcomponent(g); // Fills with background color, white. for (int i = 0; i < rects.size(); i++) { ColoredRect rect = (ColoredRect)rects.get(i);

10 g.setcolor(rect.color); g.fillrect(rect.x, rect.y, rect.width, rect.height); g.setcolor(color.black); g.drawrect(rect.x, rect.y, rect.width - 1, rect.height - 1); public void mousepressed(mouseevent evt) { // The user clicked on the canvas. This can have several effects... if (dragging) // If dragging is already in progress, just return. return; if (evt.ismetadown()) { // User right-clicked or command clicked. Make a new // rectangle and add it to the canvas. Every rectangle is // 60 pixels wide and 30 pixels tall. The point where the // user clicked is at the center of the rectangle. It's // color is the selected color in the colorinput palette. ColoredRect rect = new ColoredRect(); rect.x = evt.getx() - 30; rect.y = evt.gety() - 15; rect.width = 60;

11 rect.height = 30; rect.color = colorinput.getselectedcolor(); rects.add(rect); repaint(); else if (evt.isshiftdown()) { // User shift-clicked. More the rect that the user // clicked (if any) to the front. Note that findrect() // might return null, but bringtofront() accounts for that. bringtofront( findrect( evt.getx(), evt.gety() ) ); else if (evt.isaltdown()) { // User alt-clicked or middle-clicked. Delete the rect // that the user clicked. deleterect( findrect( evt.getx(), evt.gety() ) ); else { // This is a simple left-click. Start dragging the // rect that the user clicked (if any). dragrect = findrect( evt.getx(), evt.gety() ); if (dragrect!= null) { dragging = true; // Begin a drag operation. offsetx = evt.getx() - dragrect.x;

12 offsety = evt.gety() - dragrect.y; // end mousepressed() public void mousereleased(mouseevent evt) { // End the drag operation, if one is in progress. if (dragging == false) return; dragrect = null; dragging = false; public void mousedragged(mouseevent evt) { // Continue the drag operation if one is in progress. // Move the rect that is being dragged to the current // mouse position. But clamp it so that it can't // be more than halfway off the screen. if (dragging == false) return;

13 dragrect.x = evt.getx() - offsetx; // Get new postion of rect. dragrect.y = evt.gety() - offsety; /* Clamp (x,y) to a permitted range, as described above. */ if (dragrect.x < - dragrect.width / 2) dragrect.x = - dragrect.width / 2; else if (dragrect.x + dragrect.width/2 > getsize().width) dragrect.x = getsize().width - dragrect.width / 2; if (dragrect.y < - dragrect.height / 2) dragrect.y = - dragrect.height / 2; else if (dragrect.y + dragrect.height/2 > getsize().height) dragrect.y = getsize().height - dragrect.height / 2; /* Redraw the canvas, with the rect in its new position. */ repaint(); // end mousedragged() public void mouseclicked(mouseevent evt) { public void mouseentered(mouseevent evt) {

14 public void mouseexited(mouseevent evt) { public void mousemoved(mouseevent evt) { // end nested class Rects // end class SimpleDrawRects Bài 2: Viết chương trình paint đơn giản, cho phép dùng chuột vẽ như minh họa sau: Minh họa: Hươ ng dâñ: /* A simple program where the user can sketch curves in a variety of colors. A color palette is shown on the right of the applet.

15 The user can select a drawing color by clicking on a color in the palette. Under the colors is a "Clear button" that the user can press to clear the sketch. The user draws by clicking and dragging in a large white area that occupies most of the applet. The user's drawing is not persistant. It is cleared if the applet is resized. If it is covered, in whole or part, and then uncovered, the part was covered is gone. */ import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.jframe; public class SimplePaint extends JFrame implements MouseListener, MouseMotionListener { private final static int BLACK = 0, RED = 1, GREEN = 2, BLUE = 3, // Some constants to make // the code more readable. // These numbers code for

16 CYAN = 4, // the differnet drawing colors. MAGENTA = 5, YELLOW = 6; private int currentcolor = BLACK; // The currently selected drawing color, // coded as one of the above constants. /* The following variables are used when the user is sketching a curve while dragging a mouse. */ private int prevx, prevy; // The previous location of the mouse. private boolean dragging; // This is set to true while the user is drawing. private Graphics graphicsfordrawing; // A graphics context for the applet // that is used to draw the user's curve. public SimplePaint() { // When the applet is first created, the applet is set to // listen for mouse events and mouse motion events from // itself.

17 addmouselistener(this); addmousemotionlistener(this); public void update(graphics g) { // Redefine update so it does not fill the applet with the // background color before calling paint(). This is OK // since the paint() method always draws over the entire // surface of the applet. paint(g); public void paint(graphics g) { // Draw the contents of the applet. Since no information is // saved about what the user has drawn, the user's drawing // is erased whenever this routine is called. int width = getsize().width; // Width of the applet. int height = getsize().height; // Height of the applet. int colorspacing = (height - 56) / 7;

18 // Distance between the top of one colored rectangle in the palette // and the top of the rectangle below it. The height of the // rectangle will be colorspacing - 3. There are 7 colored rectangles, // so the available space is divided by 7. The available space allows // for the gray border and the 50-by-50 CLEAR button. /* First, fill in the white drawing area, allowing for a three-pixel border at top, bottom, and left and allowing for the 56-pixel wide strip on the right that is occupied by the color palette and CLEAR button. (I could just fill the whole applet with white and then draw over some of it, but that leads to increased flickering when the applet is redrawn.) */ g.setcolor(color.white); g.fillrect(3, 3, width - 59, height - 6); /* Draw a 3-pixel border around the applet in gray. This has to be done by drawing three rectangles of different sizes. */ g.setcolor(color.gray); g.drawrect(0, 0, width-1, height-1); g.drawrect(1, 1, width-3, height-3);

19 g.drawrect(2, 2, width-5, height-5); /* Draw a 56-pixel wide gray rectangle along the right edge of the applet. The color palette and Clear button will be drawn on top of this. (This covers some of the same area as the border I just drew. */ g.fillrect(width - 56, 0, 56, height); /* Draw the "Clear button" as a 50-by-50 white rectangle in the lower right corner of the applet, allowing for a 3-pixel border. */ g.setcolor(color.white); g.fillrect(width-53, height-53, 50, 50); g.setcolor(color.black); g.drawrect(width-53, height-53, 49, 49); g.drawstring("clear", width-48, height-23); /* Draw the seven color rectangles. */ g.setcolor(color.black); g.fillrect(width-53, 3 + 0*colorSpacing, 50, colorspacing-3); g.setcolor(color.red); g.fillrect(width-53, 3 + 1*colorSpacing, 50, colorspacing-3);

20 g.setcolor(color.green); g.fillrect(width-53, 3 + 2*colorSpacing, 50, colorspacing-3); g.setcolor(color.blue); g.fillrect(width-53, 3 + 3*colorSpacing, 50, colorspacing-3); g.setcolor(color.cyan); g.fillrect(width-53, 3 + 4*colorSpacing, 50, colorspacing-3); g.setcolor(color.magenta); g.fillrect(width-53, 3 + 5*colorSpacing, 50, colorspacing-3); g.setcolor(color.yellow); g.fillrect(width-53, 3 + 6*colorSpacing, 50, colorspacing-3); /* Draw a 2-pixel white border around the color rectangle of the current drawing color. */ g.setcolor(color.white); g.drawrect(width-55, 1 + currentcolor*colorspacing, 53, colorspacing); g.drawrect(width-54, 2 + currentcolor*colorspacing, 51, colorspacing-2); // end paint() private void changecolor(int y) {

21 // Change the drawing color after the user has clicked the // mouse on the color palette at a point with y-coordinate y. // (Note that I can't just call repaint and redraw the whole // applet, since that whould erase the user's drawing.) int width = getsize().width; int height = getsize().height; // Width of applet. // Height of applet. int colorspacing = (height - 56) / 7; // Space for one color rectangle. int newcolor = y / colorspacing; // Which color number was clicked? if (newcolor < 0 newcolor > 6) // Make sure the color number is valid. return; /* Remove the hilite from the current color, by drawing over it in gray. Then change the current drawing color and draw a hilite around the new drawing color. */ Graphics g = getgraphics(); g.setcolor(color.gray); g.drawrect(width-55, 1 + currentcolor*colorspacing, 53, colorspacing); g.drawrect(width-54, 2 + currentcolor*colorspacing, 51, colorspacing-2); currentcolor = newcolor; g.setcolor(color.white);

22 g.drawrect(width-55, 1 + currentcolor*colorspacing, 53, colorspacing); g.drawrect(width-54, 2 + currentcolor*colorspacing, 51, colorspacing-2); g.dispose(); // end changecolor() private void setupdrawinggraphics() { // This routine is called in mousepressed when the // user clicks on the drawing area. It sets up the // graphics context, graphicsfordrawing, to be used // to draw the user's sketch in the current color. graphicsfordrawing = getgraphics(); switch (currentcolor) { case BLACK: graphicsfordrawing.setcolor(color.black); break; case RED: graphicsfordrawing.setcolor(color.red); break; case GREEN: graphicsfordrawing.setcolor(color.green); break;

23 case BLUE: graphicsfordrawing.setcolor(color.blue); break; case CYAN: graphicsfordrawing.setcolor(color.cyan); break; case MAGENTA: graphicsfordrawing.setcolor(color.magenta); break; case YELLOW: graphicsfordrawing.setcolor(color.yellow); break; // end setupdrawinggraphics() public void mousepressed(mouseevent evt) { // This is called when the user presses the mouse anywhere // in the applet. There are three possible responses, // depending on where the user clicked: Change the // current color, clear the drawing, or start drawing // a curve. (Or do nothing if user clicks on the border.)

24 int x = evt.getx(); // x-coordinate where the user clicked. int y = evt.gety(); // y-coordinate where the user clicked. int width = getsize().width; // Width of the applet. int height = getsize().height; // Height of the applet. if (dragging == true) // Ignore mouse presses that occur return; // when user is already drawing a curve. // (This can happen if the user presses // two mouse buttons at the same time.) if (x > width - 53) { // User clicked to the right of the drawing area. // This click is either on the clear button or // on the color palette. if (y > height - 53) repaint(); // Clicked on "CLEAR button". else changecolor(y); // Clicked on the color palette. else if (x > 3 && x < width - 56 && y > 3 && y < height - 3) { // The user has clicked on the white drawing area. // Start drawing a curve from the point (x,y).

25 prevx = x; prevy = y; dragging = true; setupdrawinggraphics(); // end mousepressed() public void mousereleased(mouseevent evt) { // Called whenever the user releases the mouse button. // If the user was drawing a curve, the curve is done, // so we should set drawing to false and get rid of // the graphics context that we created to use during // the drawing. if (dragging == false) return; // Nothing to do because the user isn't drawing. dragging = false; graphicsfordrawing.dispose(); graphicsfordrawing = null;

26 public void mousedragged(mouseevent evt) { // Called whenever the user moves the mouse // while a mouse button is held down. If the // user is drawing, draw a line segment from the // previous mouse location to the current mouse // location, and set up prevx and prevy for the // next call. Note that in case the user drags // ouside of the drawing area, the values of // x and y are "clamped" to lie within this // area. This avoids drawing on the color palette // or clear buton. if (dragging == false) return; // Nothing to do because the user isn't drawing. int x = evt.getx(); // x-coordinate of mouse. int y = evt.gety(); // y=coordinate of mouse. if (x < 3) // Adjust the value of x, x = 3; // to make sure it's in if (x > getsize().width - 57) // the drawing area. x = getsize().width - 57;

27 if (y < 3) // Adjust the value of y, y = 3; // to make sure it's in if (y > getsize().height - 4) // the drawing area. y = getsize().height - 4; graphicsfordrawing.drawline(prevx, prevy, x, y); // Draw the line. prevx = x; // Get ready for the next line segment in the curve. prevy = y; // end mousedragged. public void mouseentered(mouseevent evt) { // Some empty routines. public void mouseexited(mouseevent evt) { // (Required by the MouseListener public void mouseclicked(mouseevent evt) { // and MouseMotionListener public void mousemoved(mouseevent evt) { // interfaces). // end class SimplePaint Bài 3: Viết chương trình xử lý sự kiện bàn phím như minh họa sau: sư duṇg ba n phi m điê u hươ ng (muḭ tên left, right, up, down) đê di chuyê n hi nh vuông ma u đo.

28 Hươ ng dâñ: /* */ A colored square is drawn on the JFrame. By pressing the arrow keys, the user can move the square up, down, left, or right. By pressing the keys R, G, B, or K, the user can change the color of the square to red, green, blue, or black, respectively. Of course, none of the keys will have any effect if the applet does not have the keyboard input focus. The applet changes appearance when it has the input focus. A cyan-colored border is drawn around it. When it does not have the input focus, the message "Click to activate" is displayed and the border is gray. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class KeyboardAndFocusDemo extends JFrame implements KeyListener, FocusListener, MouseListener { // (Note: MouseListener is implemented only so that // the applet can request the input focus when // the user clicks on it.) static final int SQUARE_SIZE = 40; // Length of a side of the square. Color squarecolor; // The color of the square. int squaretop, squareleft; // Coordinates of top-left corner of square. boolean focussed = false; // True when this applet has input focus. DisplayPanel canvas; // The drawing surface on which the applet draws, // belonging to a nested class DisplayPanel, which

29 // is defined below. public KeyboardAndFocusDemo () { // Initialize the applet; set it up to receive keyboard // and focus events. Place the square in the middle of // the applet, and make the initial color of the square red. // Then, set up the drawing surface. squaretop = getsize().height / 2 - SQUARE_SIZE / 2; squareleft = getsize().width / 2 - SQUARE_SIZE / 2; squarecolor = Color.red; pane. canvas = new DisplayPanel(); // Create drawing surface and setcontentpane(canvas); // install it as the applet's content canvas.setbackground(color.white); // Set the background color of the canvas. canvas.addfocuslistener(this); // Set up the applet to listen for events canvas.addkeylistener(this); // from the canvas. canvas.addmouselistener(this); // end init(); class DisplayPanel extends JPanel { // An object belonging to this nested class is used as // the content pane of the applet. It displays the // moving square on a white background with a border // that changes color depending on whether this // component has the input focus or not. public void paintcomponent(graphics g) { super.paintcomponent(g); // Fills the panel with its // background color, which is white. /* Draw a 3-pixel border, colored cyan if the applet has the keyboard focus, or in light gray if it does not. */ if (focussed) g.setcolor(color.cyan); else g.setcolor(color.lightgray); int width = getsize().width; // Width of the applet. int height = getsize().height; // Height of the applet. g.drawrect(0,0,width-1,height-1); g.drawrect(1,1,width-3,height-3); g.drawrect(2,2,width-5,height-5); /* Draw the square. */ g.setcolor(squarecolor); g.fillrect(squareleft, squaretop, SQUARE_SIZE, SQUARE_SIZE);

30 /* If the applet does not have input focus, print a message. */ if (!focussed) { g.setcolor(color.magenta); g.drawstring("click to activate",7,20); // end paintcomponent() // end nested class DisplayPanel // Event handling methods public void focusgained(focusevent evt) { // The applet now has the input focus. focussed = true; canvas.repaint(); // redraw with cyan border public void focuslost(focusevent evt) { // The applet has now lost the input focus. focussed = false; canvas.repaint(); // redraw without cyan border public void keytyped(keyevent evt) { // The user has typed a character, while the // applet has the input focus. If it is one // of the keys that represents a color, change // the color of the square and redraw the applet. char ch = evt.getkeychar(); // The character typed. if (ch == 'B' ch == 'b') { squarecolor = Color.blue; canvas.repaint(); else if (ch == 'G' ch == 'g') { squarecolor = Color.green; canvas.repaint(); else if (ch == 'R' ch == 'r') { squarecolor = Color.red; canvas.repaint(); else if (ch == 'K' ch == 'k') { squarecolor = Color.black; canvas.repaint(); // end keytyped() public void keypressed(keyevent evt) { // Called when the user has pressed a key, which can be

31 // a special key such as an arrow key. If the key pressed // was one of the arrow keys, move the square (but make sure // that it doesn't move off the edge, allowing for a // 3-pixel border all around the applet). int key = evt.getkeycode(); // keyboard code for the key that was pressed if (key == KeyEvent.VK_LEFT) { squareleft -= 8; if (squareleft < 3) squareleft = 3; canvas.repaint(); else if (key == KeyEvent.VK_RIGHT) { squareleft += 8; if (squareleft > getsize().width SQUARE_SIZE) squareleft = getsize().width SQUARE_SIZE; canvas.repaint(); else if (key == KeyEvent.VK_UP) { squaretop -= 8; if (squaretop < 3) squaretop = 3; canvas.repaint(); else if (key == KeyEvent.VK_DOWN) { squaretop += 8; if (squaretop > getsize().height SQUARE_SIZE) squaretop = getsize().height SQUARE_SIZE; canvas.repaint(); // end keypressed() public void keyreleased(keyevent evt) { // empty method, required by the KeyListener Interface public void mousepressed(mouseevent evt) { // Request that the input focus be given to the // canvas when the user clicks on the applet. canvas.requestfocus(); public void mouseentered(mouseevent evt) { // Required by the public void mouseexited(mouseevent evt) { // MouseListener public void mousereleased(mouseevent evt) { // interface. public void mouseclicked(mouseevent evt) { // end class KeyboardAndFocusDemo

32 E. Kết quả thực hành. - Sinh viên thực hành ứng dụng trên GUI. - Thời gian thực hành: 4 tiết. F. Đánh giá: - Kiểm tra lại chương trình, thử các kết quả. - Bắt các lỗi bằng cách sử dụng các phần bắt lỗi: try catch. G.Phụ lục(file đi kèm) Hết

LAB 4(4 tiết): Thực hành ứng dụng GUI(tiếp)

LAB 4(4 tiết): Thực hành ứng dụng GUI(tiếp) THỰC HÀNH CÔNG CỤ VÀ MÔI TRƯỜNG VÀ LẬP TRÌNH 2 --------------------------------------------------------------------------------------------------- TS. Võ Phương Bình Email: binhvp@dlu.edu.vn Information

More information

LAB 6(4 tiết): Áp dụng các sự kiện chuột, bàn phím và các hàm vẽ

LAB 6(4 tiết): Áp dụng các sự kiện chuột, bàn phím và các hàm vẽ THỰC HÀNH CÔNG CỤ VÀ MÔI TRƯỜNG VÀ LẬP TRÌNH 2 --------------------------------------------------------------------------------------------------- TS. Võ Phương Bình Email: binhvp@dlu.edu.vn Information

More information

Khối: Cao Đẳng nghề và Trung Cấp Năm 2009

Khối: Cao Đẳng nghề và Trung Cấp Năm 2009 Hướng Dẫn Thực Hành Lập Trình Windows Khối: Cao Đẳng nghề và Trung Cấp Năm 2009 Hướng dẫn: Bài tập thực hành được chia làm nhiều Module Mỗi Module được thiết kế cho thời lượng là 3 tiết thực hành tại lớp

More information

BÀI TẬP THỰC HÀNH LẬP TRÌNH WINDOWS C#

BÀI TẬP THỰC HÀNH LẬP TRÌNH WINDOWS C# BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƯỜNG ĐẠI HỌC SƯ PHẠM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN http://www.hcmup.edu.vn BÀI TẬP THỰC HÀNH LẬP TRÌNH WINDOWS C# Phần 1: Làm quen với ứng dụng Form 1. Bài tập mở đầu 1.1. Khởi

More information

CẤU TRÚC DỮ LIỆU NÂNG CAO

CẤU TRÚC DỮ LIỆU NÂNG CAO CẤU TRÚC DỮ LIỆU NÂNG CAO Các kiến thức yêu cầu Tóm tắt nội dung môn học Phương pháp kiểm tra đánh giá Tài liệu tham khảo 1 Các kiến thức yêu cầu Các thuật toán và cấu trúc dữ liệu cơ bản Ngôn ngữ lập

More information

Cài đặt và cấu hình StarWind iscsi trên Windows. iscsi SAN là gì?

Cài đặt và cấu hình StarWind iscsi trên Windows. iscsi SAN là gì? iscsi SAN là gì? iscsi là Internet SCSI ( Small Computer System Interface ) là một chuẩn công nghiệp phát triển để cho phép truyền tải các lệnh SCSI qua mạng IP hiện có bằng cách sử dụng giao thức TCP/IP.

More information

Cụ thể những công việc mà AndroidManifest.xml thực hiện: - Đặt tên cho Java package của ứng dụng.

Cụ thể những công việc mà AndroidManifest.xml thực hiện: - Đặt tên cho Java package của ứng dụng. Trong bài 1 mình đã giới thiệu sơ lược về các thành phần cơ bản của Android cũng như việc sử dụng XML để lập trình ứng dụng Android. Trong bài này mình sẽ giới thiệu thêm về Android Manifest và đi sâu

More information

Phần 1: Hướng dẫn sử dụng PictureBox tạo Slide Show

Phần 1: Hướng dẫn sử dụng PictureBox tạo Slide Show Phần 1: Hướng dẫn sử dụng PictureBox tạo Slide Show Mục tiêu Viết một chương trình C# đơn giản có thể mở và xem hình ảnh, và hiển thị từng hình trong slide show. Hướng dẫn Ta thiết kế giao diện như sau:

More information

Khoa KH & KTMT Bộ môn Kỹ Thuật Máy Tính

Khoa KH & KTMT Bộ môn Kỹ Thuật Máy Tính dce Khoa KH & KTMT Bộ môn Kỹ Thuật Máy Tính, CE Department dce Tài liệu tham khảo Digital Systems, Principles and Applications, 8 th /5 th Edition, R.J. Tocci, Prentice Hall Digital Logic Design Principles,

More information

SIEMENS INDUSTRIAL NETWORKS

SIEMENS INDUSTRIAL NETWORKS SIEMENS INDUSTRIAL NETWORKS 1 ASI NETWORK INTRODUCTION Number of slaves Up to 62 Number of I/Os Up to 496 inputs and 496 outputs Medium Line length Cycle time Data transfer Unshielded two-wire line for

More information

Java Mouse Actions. C&G criteria: 5.2.1, 5.4.1, 5.4.2,

Java Mouse Actions. C&G criteria: 5.2.1, 5.4.1, 5.4.2, Java Mouse Actions C&G criteria: 5.2.1, 5.4.1, 5.4.2, 5.6.2. The events so far have depended on creating Objects and detecting when they receive the event. The position of the mouse on the screen can also

More information

Bộ môn HTMT&TT, Khoa Công Nghệ Thông Tin và TT, ĐH Cần Thơ

Bộ môn HTMT&TT, Khoa Công Nghệ Thông Tin và TT, ĐH Cần Thơ RPC và RMI Khái niệm RPC Khái niệm RMI Các bước cài đặt RMI trong Java Ví dụ về RMI 1 RPC (Remote Procedure Call) Khái niệm RPC: gọi thủ tục ở xa. Trong suốt về mặt ngữ nghĩa: gọi thủ tục ở xa cũng có

More information

Hướng dẫn cài đặt FPT

Hướng dẫn cài đặt  FPT Hướng dẫn cài đặt Email FPT ---X--- Cài đặt email @FPT.VN bằng phần mềm Thunder Bird Bước 1: Mở Thunder Bird, chọn Tools >> Account Setting Bước 2: Tại Account Setting, chọn Account Actions >> Add Mail

More information

TÀI LIỆU THỰC HÀNH MÔN CƠ SỞ DỮ LIỆU NÂNG CAO

TÀI LIỆU THỰC HÀNH MÔN CƠ SỞ DỮ LIỆU NÂNG CAO TÀI LIỆU THỰC HÀNH MÔN CƠ SỞ DỮ LIỆU NÂNG CAO Mục lục Index...2 Tài liệu tham khảo...2 Công cụ...2 Nội dung...2 Cú pháp tạo index...2 Cú pháp chỉnh sửa index...2 Áp đặt tính duy nhất trên cột không khóa...3

More information

Entity Framework (EF)

Entity Framework (EF) Entity Framework (EF) Lịch sử ra đời Các khái niệm cơ bản Kiến trúc EF DB First/Model First Code First/Code Second Kế thừa Eager/Lazy & Explicit Loading Performance/Profiling Tạ Hoàng Thắng 1 Model First

More information

HƯỚNG DẪN SỬ DỤNG HỆ THỐNG CẬP NHẬT CHỨNG THƯ SỐ HOTLINE:

HƯỚNG DẪN SỬ DỤNG HỆ THỐNG CẬP NHẬT CHỨNG THƯ SỐ HOTLINE: HƯỚNG DẪN SỬ DỤNG HỆ THỐNG CẬP NHẬT CHỨNG THƯ SỐ HOTLINE: 19006276 Ngày phát hành : 03/08/2017 Nơi phát hành : Công ty CP Chữ ký số Vi Na Phiên bản : 2.0 1 Mục lục 1 Các thuật ngữ viết tắt... 3 2 Môi trường

More information

User interfaces and Swing

User interfaces and Swing User interfaces and Swing Overview, applets, drawing, action listening, layout managers. APIs: java.awt.*, javax.swing.*, classes names start with a J. Java Lectures 1 2 Applets public class Simple extends

More information

Tạo Project với MPLAB

Tạo Project với MPLAB [Pick the date] Tạo project với MPLAB, trình biên dịch CCS, program và debug với PICKit2 1. Cài đặt phần mềm MPLAB IDE v8.92 2. Cài đặt phần mềm CCS PIC C Compiler 3. Tạo project trên MPLAB với trình biên

More information

Giáo trình này được biên dịch theo sách hướng dẫn của Sun Light. Vì là hướng dẫn kỹ thuật, trong này những thuật ngữ kỹ thuật bằng tiếng Anh tôi chỉ

Giáo trình này được biên dịch theo sách hướng dẫn của Sun Light. Vì là hướng dẫn kỹ thuật, trong này những thuật ngữ kỹ thuật bằng tiếng Anh tôi chỉ Giáo trình này được biên dịch theo sách hướng dẫn của Sun Light. Vì là hướng dẫn kỹ thuật, trong này những thuật ngữ kỹ thuật bằng tiếng Anh tôi chỉ dịch một lần cho các bạn hiểu nghĩa. Những từ đó, về

More information

HTML DOM - Forms. MSc. nguyenhominhduc

HTML DOM - Forms. MSc. nguyenhominhduc HTML DOM - Forms MSc. nguyenhominhduc Đối tượng form Form là một thành phần dùng để thu thập dữ liệu, thông tin từ người dùng. Mỗi phần tử trong form là một đối tượng trong DOM. Do đó mỗi phần tử trên

More information

LẬP TRÌNH WINDOWS FORM VỚI CÁC CONTROL NÂNG CAO (Các control trình bày dữ liệu dưới dạng danh sách)

LẬP TRÌNH WINDOWS FORM VỚI CÁC CONTROL NÂNG CAO (Các control trình bày dữ liệu dưới dạng danh sách) Lab 04: LẬP TRÌNH WINDOWS FORM VỚI CÁC CONTROL NÂNG CAO (Các control trình bày dữ liệu dưới dạng danh sách) A. MỤC TIÊU: Sử dụng Visual Studio.NET 2010/2012/2013 tạo ứng dụng dạng Windows Forms với các

More information

Tài liệu hướng dẫn: Stored Procedure

Tài liệu hướng dẫn: Stored Procedure 1 Tài liệu hướng dẫn: Stored Procedure Tài liệu hướng dẫn: Stored Procedure Người thực hiện Hoàng Anh Tú Nội dung 1 Giới thiệu... 2 2 Stored Procedure cơ bản... 2 2.1 Tạo Stored Procedure... 3 2.1.1 Tạo

More information

Internet Protocol. Bởi: Phạm Nguyễn Bảo Nguyên

Internet Protocol. Bởi: Phạm Nguyễn Bảo Nguyên Internet Protocol Bởi: Phạm Nguyễn Bảo Nguyên Chúng ta đã biết cách tạo User Profile và check mail từ Exchange Server với tùy chọn này nghĩa là bạn đang check mail bằng giao thức MAPI mà chỉ có khi cài

More information

HƯỚNG DẪN SỬ DỤNG PLESK PANEL

HƯỚNG DẪN SỬ DỤNG PLESK PANEL HƯỚNG DẪN SỬ DỤNG PLESK PANEL Trang 1 I. HƯỚNG DẪN ĐĂNG NHẬP 1. Đăng nhập hệ thống Plesk: Để đăng nhập vào hệt thống plesk panel thực hiện các bước sau(hình 1): - Trên trình duyệt web gõ vào địa chỉ: https://ip:8443

More information

HƯỚNG DẪN SỬ DỤNG ĐẦU GHI H.264 DVR VISION VS (4CH - 8CH - 16CH)

HƯỚNG DẪN SỬ DỤNG ĐẦU GHI H.264 DVR VISION VS (4CH - 8CH - 16CH) HƯỚNG DẪN SỬ DỤNG ĐẦU GHI H.264 DVR VISION VS 401-801-1601 (4CH - 8CH - 16CH) Xin vui lòng đọc kỹ hướng dẫn trước khi sử dụng: + Format ổ cứng, nhấn phải chuột chọn Main Menu. + Nhấn Utility. 1 + Nhấn

More information

HƢỚNG DẪN TRIỂN KHAI KASPERSKY - MOBILE DEVICE MANAGEMENT

HƢỚNG DẪN TRIỂN KHAI KASPERSKY - MOBILE DEVICE MANAGEMENT HƢỚNG DẪN TRIỂN KHAI KASPERSKY - MOBILE DEVICE MANAGEMENT 2015 THÔNG TIN KIỂM SOÁT Đơn vị chịu trách nhiệm CÔNG TY CỔ PHẦN TÍCH HỢP HỆ THỐNG NAM TRƢỜNG SƠN. Số 20 Tăng Bạt Hổ, Phường 11, Quận Bình Thạnh.TPHCM

More information

STACK và QUEUE. Lấy STACK

STACK và QUEUE. Lấy STACK MỤC TIÊU STACK và QUEUE Hoàn tất phần thực hành này, sinh viên có thể: - Hiểu được cách thức sử dụng stack và queue trên cơ sở sử dụng danh sách liên kết để cài đặt. - Hiểu và vận dụng các cấu trúc stack

More information

I. Hướng Dẫn Đăng Nhập:

I. Hướng Dẫn Đăng Nhập: I. Hướng Dẫn Đăng Nhập: 1. Đăng nhập hệ thống Plesk: Để đăng nhập hệ thống thực hiện các bước sau: Bước 1: Trên trình duyệt web gõ địa chỉ http://hosting04.viettelidc.com.vn hoặc địa chỉ https://sww01.viettelidc.com.vn:8443

More information

Lab01: M V C Lưu ý: Để thực hành, các bạn phải cài Visual Studio 2013 trở lên mới hỗ trợ MVC5.

Lab01: M V C Lưu ý: Để thực hành, các bạn phải cài Visual Studio 2013 trở lên mới hỗ trợ MVC5. Lab01: M V C Lưu ý: Để thực hành, các bạn phải cài Visual Studio 2013 trở lên mới hỗ trợ MVC5. 1 Mục đích Giới thiệu mô hình MVC Model, Controller, View Phân biệt ViewData, ViewBag, TempData 2 Khởi động

More information

LÂ P TRI NH WEB ASP.NET

LÂ P TRI NH WEB ASP.NET Trươ ng Đa i Ho c La c Hô ng 2009-2010 LÂ P TRI NH WEB ASP.NET Ts. Vu Đư c Lung Ks. Phan Hư u Tiê p Chương 6: Building and Managing Website 1 http://lhu.edu.vn LHU Xây dựng và quản lý Website ASP.NET OBJECTS

More information

Đa ngôn ngữ (Internationalization) trong Servlet

Đa ngôn ngữ (Internationalization) trong Servlet Đa ngôn ngữ (Internationalization) trong Servlet Trước khi vào bài, chúng tôi giải thích 3 khái niệm quan trọng: Internationalization (i18n): Nghĩa là kích hoạt một trang có khả năng cung cấp nhiều phiên

More information

BELGIUM ONLINE APPOINTMENT

BELGIUM ONLINE APPOINTMENT BELGIUM ONLINE APPOINTMENT Online Appointment Link/ Link đặt hẹn online: http://www.vfsglobal.com/belgium/vietnam/vietnamese/schedule-anappointment.html Using for applicants who wish to apply for Belgium

More information

HƯỚNG DẪN CÀI ĐẶT PHẦN MỀM DIỆT VIRUS AVIRA

HƯỚNG DẪN CÀI ĐẶT PHẦN MỀM DIỆT VIRUS AVIRA HƯỚNG DẪN CÀI ĐẶT PHẦN MỀM DIỆT VIRUS AVIRA A V I R A A N T O À N H Ơ N Trang 1 Mục lục 1. Trước khi cài đặt... 3 1.1 Kiểm tra khả năng đáp ứng của hệ thống:... 3 1.2 Hướng dẫn nâng cấp:... 3 1.3 Hướng

More information

GV: Phạm Đình Sắc or

GV: Phạm Đình Sắc   or Giới Thiệu: Lập trình ứng dụng Windows Form in VB.Net 2005 Thời lượng: 45 tiết LT 30 tiết TH GV: Phạm Đình Sắc Email: sacvn@yahoo.com or dinhsac@gmail.com Windows Form programming with VB.Net 2005. 1 Buổi

More information

Exceptions. Outline 7/31/2012. Exceptions. Exception handling is an important aspect of objectoriented. Chapter 10 focuses on:

Exceptions. Outline 7/31/2012. Exceptions. Exception handling is an important aspect of objectoriented. Chapter 10 focuses on: Exceptions Exceptions Exception handling is an important aspect of objectoriented design Chapter 10 focuses on: the purpose of exceptions exception messages the try-catch statement propagating exceptions

More information

BÀI 1: VBA LÀ GÌ? TẠO MACRO, ỨNG DỤNG CÁC HÀM TỰ TẠO (UDF), CÀI ĐẶT ADD-INS VBA là gì?

BÀI 1: VBA LÀ GÌ? TẠO MACRO, ỨNG DỤNG CÁC HÀM TỰ TẠO (UDF), CÀI ĐẶT ADD-INS VBA là gì? BÀI 1: VBA LÀ GÌ? TẠO MACRO, ỨNG DỤNG CÁC HÀM TỰ TẠO (UDF), CÀI ĐẶT ADD-INS VBA là gì? Nguyễn Duy Tuân: 0904.210.337 1/12 Macro là gì? Macro là một lệnh lệnh thực thi một hay nhiều thao tác người dùng

More information

Online Appointment System will work better with below conditions/ Hệ thống đặt hẹn online sẽ hoạt động tốt hơn với điều kiện sau đây:

Online Appointment System will work better with below conditions/ Hệ thống đặt hẹn online sẽ hoạt động tốt hơn với điều kiện sau đây: Online Appointment Link/ Link đặt hẹn online: http://www.vfsglobal.com/netherlands/vietnam/schedule-an- Appointment.html ( Using for applicants who wish to apply for The Netherlands visas at VFS Netherlands

More information

Tröôøng Ñaïi Hoïc Baùch Khoa Tp.HCM LẬP TRÌNH MINICHAT. Bài giảng 3. Trang1. Khoa Khoa Học Và Kỹ Thuật Máy Tính

Tröôøng Ñaïi Hoïc Baùch Khoa Tp.HCM LẬP TRÌNH MINICHAT. Bài giảng 3. Trang1. Khoa Khoa Học Và Kỹ Thuật Máy Tính LẬP TRÌNH MINICHAT Bài giảng 3 Khoa Khoa Học Và Kỹ Thuật Máy Tính Trang1 MiniChat: Chức Năng Chức năng Cho phép nhiều user đăng ký vào các nhómđể trò chuyện với nhau. Hình thức trò chuyện Một user với

More information

HƯỚNG DẪN SỬ DỤNG NHANH MINDJET MIND MANAGER

HƯỚNG DẪN SỬ DỤNG NHANH MINDJET MIND MANAGER Hướng dẫn sử dụng nhanh Mindjet Mind Manager_ChinSu 1 HƯỚNG DẪN SỬ DỤNG NHANH MINDJET MIND MANAGER 1. Sử dụng Open - Import - Save - Print - Send - Export của Mindjrt Mind Manager : 1.1. Tạo file mới :

More information

SIMULATE AND CONTROL ROBOT

SIMULATE AND CONTROL ROBOT SIMULATE AND CONTROL ROBOT CÁC BƯỚC THỰC HIỆN MÔ PHỎNG ĐIỀU KHIỂN ROBOT: Vẽ lại mô hình robot trong PRO_E 4.0. Liên kết mô hình với phần MATHLAB 2008. Xây dựng giao diện MATHLAB để điều khiển các mô hình.

More information

GIẢI THUẬT ĐỊNH TUYẾN (ROUTING ALGORITHM)

GIẢI THUẬT ĐỊNH TUYẾN (ROUTING ALGORITHM) Chương 8 GIẢI THUẬT ĐỊNH TUYẾN (ROUTING ALGORITHM) Giải thuật định tuến 4- NỘI DUNG Tổng quan Link state Distance Vector Hierarchical routing Giải thuật định tuến 4- Tổng quan: Phối hợp giữa routing và

More information

ĐỌC, GHI XML VỚI C# TRONG ADO.NET --- SỬ DỤNG VISUAL STUDIO

ĐỌC, GHI XML VỚI C# TRONG ADO.NET --- SỬ DỤNG VISUAL STUDIO TRUNG TÂM TIN HỌC ĐẠI HỌC KHOA HỌC TỰ NHIÊN-TP.HCM ĐỌC, GHI XML VỚI C# TRONG ADO.NET --- SỬ DỤNG VISUAL STUDIO 2010 --- 1 TRUNG TÂM TIN HỌC ĐẠI HỌC KHOA HỌC TỰ NHIÊN-TP.HCM Nội dung 1. Tổng quan về v XML

More information

Nhấn nút New để tạo 1 biến mới Trang 17

Nhấn nút New để tạo 1 biến mới Trang 17 Thiết lập biến môi trường để chạy java ở cơ chế command-line Mở System Properties, Chọn thẻ Advanced Nhấn nút Environment Variables Nhấn nút New để tạo 1 biến mới Đường dẫn đến thư mục cài đặt JDK Nhấn

More information

B3: Bên khung Package Explore bên trái đi tới thư mục res, bạn sẽ thấy có 3 thư mục con:

B3: Bên khung Package Explore bên trái đi tới thư mục res, bạn sẽ thấy có 3 thư mục con: B3: Bên khung Package Explore bên trái đi tới thư mục res, bạn sẽ thấy có 3 thư mục con: - drawable: thư mục chứa các hình ảnh để làm icon hoặc tài nguyên cho giao diện... - layout: chứa các file xml để

More information

Nội dung chính của chương. Các công nghệ đĩa cứng Cấu tạo vật lý của đĩa cứng Cấu tạo logic của đĩa cứng Cài đặt đĩa cứng như thế nào?

Nội dung chính của chương. Các công nghệ đĩa cứng Cấu tạo vật lý của đĩa cứng Cấu tạo logic của đĩa cứng Cài đặt đĩa cứng như thế nào? Chương 6 Đĩa cứng Nội dung chính của chương Các công nghệ đĩa cứng Cấu tạo vật lý của đĩa cứng Cấu tạo logic của đĩa cứng Cài đặt đĩa cứng như thế nào? Công nghệ đĩa cứng Đĩa cứng đọc/ghi dữ liệu như thế

More information

Phần 2. SỬ DỤNG POWERPOINT ĐỂ CHUẨN BỊ NỘI DUNG TRÌNH BÀY

Phần 2. SỬ DỤNG POWERPOINT ĐỂ CHUẨN BỊ NỘI DUNG TRÌNH BÀY Phần 2. SỬ DỤNG POWERPOINT ĐỂ CHUẨN BỊ NỘI DUNG TRÌNH BÀY NỘI DUNG (1) 1. Giới thiệu PowerPoint và ứng dụng trong dạy học Mục đích sử dụng Các tính năng chung Một số kỹ năng thuyết trình sử dụng PP 2.

More information

Chương 6. Transport Layer. Tài liệu : Forouzan, Data Communication and Networking

Chương 6. Transport Layer. Tài liệu : Forouzan, Data Communication and Networking Chương 6 Transport Layer Tài liệu : Forouzan, Data Communication and Networking 1 Transport Layer Nội dung Đặc trưng của tầng transport Port number Multiplexing và Demultiplexing Connectionless Service

More information

B5: Time to coding. Tới thư mục src/example.java và thay đổi nội dung file như sau: Mã: package at.exam;

B5: Time to coding. Tới thư mục src/example.java và thay đổi nội dung file như sau: Mã: package at.exam; B5: Time to coding. Tới thư mục src/example.java và thay đổi nội dung file như sau: Mã: package at.exam; import java.util.arraylist; import android.app.activity; import android.app.alertdialog; import

More information

CHƯƠNG 2: CÁC ĐẶC ĐIỂM VỀ MÔI TRƯỜNG PHÁT TRIỂN (IDE)

CHƯƠNG 2: CÁC ĐẶC ĐIỂM VỀ MÔI TRƯỜNG PHÁT TRIỂN (IDE) CHƯƠNG 2: CÁC ĐẶC ĐIỂM VỀ MÔI TRƯỜNG PHÁT TRIỂN (IDE) Phan Trọng Tiến BM Công nghệ phần mềm Khoa Công nghệ thông tin, VNUA Email: phantien84@gmail.com Website: http://timoday.edu.vn Ch2- Cac dac diem moi

More information

ĐỀ CƯƠNG CHI TIẾT HỌC PHẦN

ĐỀ CƯƠNG CHI TIẾT HỌC PHẦN BM01.QT02/ĐNT-ĐT TRƯỜNG ĐH NGOẠI NGỮ - TIN HỌC TP.HCM KHOA CÔNG NGHỆ THÔNG TIN CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM Độc lập Tự do Hạnh Phúc 1. Thông tin chung về học phần ĐỀ CƯƠNG CHI TIẾT HỌC PHẦN - Tên

More information

BÀI 6 LÀM VIỆC VỚI THÀNH PHẦN MỞ RỘNG CỦA CSS3

BÀI 6 LÀM VIỆC VỚI THÀNH PHẦN MỞ RỘNG CỦA CSS3 BÀI 6 LÀM VIỆC VỚI THÀNH PHẦN MỞ RỘNG CỦA CSS3 NHẮC LẠI BÀI TRƯỚC Làm việc với các thuộc tính mới trong CSS3: Border-radius Border-image Gradient Transform, transition, animation Làm việc với font web

More information

Bài Thực hành Asp.Net - Buổi 1 - Trang: 1

Bài Thực hành Asp.Net - Buổi 1 - Trang: 1 Bài 1.1 1. Khởi động VS2010 2. File > News > Web Site, chọn: Visual C# ASP.NET Empty Web Site Chọn vị trí lưu và đặt tên file là Bai1.1 3. Thêm trang mới (Web Form ; tên là Default.aspx) 4. Viết code như

More information

Graphical User Interfaces 2

Graphical User Interfaces 2 Graphical User Interfaces 2 CSCI 136: Fundamentals CSCI 136: Fundamentals of Computer of Science Computer II Science Keith II Vertanen Keith Vertanen Copyright 2011 Extending JFrame Dialog boxes Overview

More information

BẢO MẬT TRONG SQL SERVER

BẢO MẬT TRONG SQL SERVER Chương 8 SECURITY 1 BẢO MẬT TRONG SQL SERVER Bảo mật trong SQL Server gồm 3 lớp : Login security : kiểm soát ai có thể log vào SQL Server. Database access security : kiểm soát ai có thể truy cập vào một

More information

Method Of Key Event Key Listener must implement three methods, keypressed(), keyreleased() & keytyped(). 1) keypressed() : will run whenever a key is

Method Of Key Event Key Listener must implement three methods, keypressed(), keyreleased() & keytyped(). 1) keypressed() : will run whenever a key is INDEX Event Handling. Key Event. Methods Of Key Event. Example Of Key Event. Mouse Event. Method Of Mouse Event. Mouse Motion Listener. Example of Mouse Event. Event Handling One of the key concept in

More information

2IS45 Programming

2IS45 Programming Course Website Assignment Goals 2IS45 Programming http://www.win.tue.nl/~wsinswan/programmeren_2is45/ Rectangles Learn to use existing Abstract Data Types based on their contract (class Rectangle in Rectangle.

More information

Kỹ thuật thu nhỏ đối tượng trong Design (Layout)

Kỹ thuật thu nhỏ đối tượng trong Design (Layout) Kỹ thuật thu nhỏ đối tượng trong Design (Layout) Viết bởi : Steve Smith http://smith9x.wordpress.com - Kỹ thuật này do mình tự nghĩ ra, đơn giản hóa cụ thể như sau : + Ta sẽ thiết kế các đối tượng lớn

More information

Tình huống 1: PPPoE với Username và Password

Tình huống 1: PPPoE với Username và Password HƯỚNG DẪN CẤU HÌNH NHANH INTERNET (Vigor2912 / Vigor2925) Tình huống 1: PPPoE với Username và Password - CTY có một đường truyền cáp quang. - Nhà mạng đã cho mượn Converter quang và router - Router đó

More information

Bộ môn MMT&TT, Khoa Công Nghệ Thông Tin và TT, ĐH Cần Thơ

Bộ môn MMT&TT, Khoa Công Nghệ Thông Tin và TT, ĐH Cần Thơ Giới thiệu Lập trình mạng Truyền thông Cơ chế giao tiếp liên quá trình (IPC) Mô hình OSI Mạng TCP/IP Dịch vụ mạng Mô hình Client/Server Các kiểu kiến trúc chương trình 1 Truyền thông Là sự giao tiếp, trao

More information

Chương 7. Application Layer. Tài liệu : Forouzan, Data Communication and Networking

Chương 7. Application Layer. Tài liệu : Forouzan, Data Communication and Networking Chương 7 Application Layer Tài liệu : Forouzan, Data Communication and Networking 1 Các ứng dụng mạng Network Applications Là những chương trình chạy trên những đầu cuối khác nhau, giao tiếp với nhau thông

More information

Chương 5. Network Layer. Phần 1 - Địa chỉ IPv4. Tài liệu : Forouzan, Data Communication and Networking

Chương 5. Network Layer. Phần 1 - Địa chỉ IPv4. Tài liệu : Forouzan, Data Communication and Networking Chương 5 Network Layer Phần 1 - Địa chỉ IPv4 Tài liệu : Forouzan, Data Communication and Networking 1 Nội dung Địa chỉ IPv4 Internetworking Giao thức Internet (IP) Địa chỉ IPv6 2 Chức năng tầng Network

More information

Bài tập lớn số 1. Giả lập bộ định thời

Bài tập lớn số 1. Giả lập bộ định thời Ghi chú: Bài tập lớn số 1 Giả lập bộ định thời Sinh viên nộp bài tại trang web: www.cse.hcmut.edu.vn/portal File nộp bài đặt tên là: ass1.tar.bz2 Hạn chót nộp bài: 08:00am 10/08/2010 SV có thể chỉnh sửa

More information

NHÚNG. Vi ñiều khiển BM Kỹ Thuật ðiện Tử - ðh Bách Khoa TP.HCM 2

NHÚNG. Vi ñiều khiển BM Kỹ Thuật ðiện Tử - ðh Bách Khoa TP.HCM 2 LẬP TRÌNH HỆ THỐNG NHÚNG BÙI QUỐC BẢO Vi ñiều khiển 8051 BM Kỹ Thuật ðiện Tử - ðh Bách Khoa TP.HCM 2 1 Vi ñiều khiển 8051 BM Kỹ Thuật ðiện Tử - ðh Bách Khoa TP.HCM 3 Phần mềm KEIL PROTEUS BM Kỹ Thuật ðiện

More information

G51PRG: Introduction to Programming Second semester Applets and graphics

G51PRG: Introduction to Programming Second semester Applets and graphics G51PRG: Introduction to Programming Second semester Applets and graphics Natasha Alechina School of Computer Science & IT nza@cs.nott.ac.uk Previous two lectures AWT and Swing Creating components and putting

More information

Bài 10: Cấu trúc dữ liệu

Bài 10: Cấu trúc dữ liệu KHOA CÔNG NGHỆ THÔNG TIN BỘ MÔN CÔNG NGHỆ PHẦN MỀM Bài 10: Bài giảng LẬP TRÌNH CƠ BẢN Tài liệu tham khảo Kỹ thuật lập trình C: cơ sở và nâng cao, Phạm Văn Ất, Nhà xuất bản KHKT Chương 7 2 Mục tiêu Tìm

More information

Chủ đề 7: Triển khai và Bảo trì. COMP1026 Introduction to Software Engneering CH7-1 HIENLTH

Chủ đề 7: Triển khai và Bảo trì. COMP1026 Introduction to Software Engneering CH7-1 HIENLTH Chủ đề 7: Triển khai và Bảo trì COMP1026 Introduction to Software Engneering CH7-1 HIENLTH COMP1026 Introduction to Software Engneering CH7-2 HIENLTH Giai đoạn triển khai Khảo sát Phân tích Thiết kế Đóng

More information

Chương 5. Network Layer 19/09/2016 1

Chương 5. Network Layer 19/09/2016 1 Chương 5 Network Layer 19/09/2016 1 Nội dung Địa chỉ IPv4 Địa chỉ IPv6 Internetworking Giao thức Internet (IP) Chuyển đổi từ IPv4 sang IPv6 19/09/2016 2 Địa chỉ IPv4 Là địa chỉ 32 bit duy nhất, nhận diện

More information

Mô hình dữ liệu quan hệ (Relational data model)

Mô hình dữ liệu quan hệ (Relational data model) Mô hình dữ liệu quan hệ (Relational data model) 1 Nội dung 1. Mô hình dữ liệu quan hệ (Relational data model) 2. Phép toán tập hợp (Set Operation) 3. Phép toán đại số quan hệ (Relational Algebra Operation)

More information

BÀI GIẢNG CHƯƠNG 3 GIAO TIẾP KẾT NỐI SỐ LIỆU

BÀI GIẢNG CHƯƠNG 3 GIAO TIẾP KẾT NỐI SỐ LIỆU BỘ CÔNG THƯƠNG TRƯỜNG CAO ĐẲNG KỸ THUẬT CAO THẮNG KHOA ĐIỆN TỬ - TIN HỌC BÀI GIẢNG CHƯƠNG 3 GIAO TIẾP KẾT NỐI SỐ LIỆU Môn Học TRUYỀN SỐ LIỆU NỘI DUNG 3.1 Các khái niệm cơ bản về truyền số liệu 3.2 Thông

More information

TÀI LIỆU HƯỚNG DẪN SỬ DỤNG HOSTING PLESK PANEL

TÀI LIỆU HƯỚNG DẪN SỬ DỤNG HOSTING PLESK PANEL Fall 08 CÔNGTYCỔPHẦNVIỄNTHÔNGFPT CÔNGTYTNHHMTVVIỄNTHÔNGQUỐCTẾFPT TÀILIỆUHƯỚNGDẪNSỬDỤNG HOSTING PLESKPANEL C T Y T N H H M T V F T I / F P T T E L E C O M MỤC LỤC I. HƯỚNG DẪN ĐĂNG NHẬP...2 1. Đăng nhập

More information

HƯỚNG DẪN CÁCH SỬ DỤNG WINDOWS MOVIE MAKER

HƯỚNG DẪN CÁCH SỬ DỤNG WINDOWS MOVIE MAKER HƯỚNG DẪN CÁCH SỬ DỤNG WINDOWS MOVIE MAKER Tiện ích của phần mềm Windows Movie Maker: Tạo Slide show trình chiếu ảnh. Tăng giảm độ sáng tối cho ảnh. Hiệu ứng chuyển ảnh. Chèn âm thanh và chỉnh sửa. Chèn

More information

Bài tập căn bản Visual Basic.Net Vòng lặp. txtn. txtketqua. btntinh. txtn. txtketqua. btntinh. Trang 1

Bài tập căn bản Visual Basic.Net Vòng lặp. txtn. txtketqua. btntinh. txtn. txtketqua. btntinh. Trang 1 1. Tính n! Ví dụ: 5!= 1 * 2 * 3 * 4 * 5 = 120 Thiết kế form theo mẫu hoặc tự thiết kế theo ý thích. Chú ý nếu đặt tên các control khác với hình bên dưới thì cần sửa lại code cho phù hợp. btntinh Doube

More information

Cập nhật ResultSet trong JDBC

Cập nhật ResultSet trong JDBC java_jdbc/index.jsp Cập nhật ResultSet trong JDBC Tương tự như khi quan sát dữ liệu trong ResultSet, bạn có thể sử dụng rất nhiều phương thức (có 2 phiên bản cho chỉ mục cột và tên cột) của ResultSet Interface

More information

LAB IP SLA Bài 1. Bùi Quốc Kỳ ***

LAB IP SLA Bài 1. Bùi Quốc Kỳ *** LAB IP SLA Bài 1 Bùi Quốc Kỳ *** Yêu cầu: 1. Cấu hình cơ bản trên các thiết bị. 2. Routing: Cấu hình định tuyến tĩnh Static Route trên các thiết bị đảm bảo mạng hội tụ. 3. PAT: Cấu hình PAT (NAT Overload)

More information

TỔNG QUAN VỀ.NET VÀ C#

TỔNG QUAN VỀ.NET VÀ C# TỔNG QUAN VỀ.NET VÀ C# PHAN TRỌNG TIẾN BM Công nghệ phần mềm Khoa Công nghệ thông tin, VNUA Email: phantien84@gmail.com Website: http://timoday.edu.vn 7/5/16 Tổng quan về.net và C# 1 Giới thiệu q.net là

More information

Câu 1: (2 điểm) So sách giữa 2 đối tượng Response và Request. Cho ví dụ minh hoạ.

Câu 1: (2 điểm) So sách giữa 2 đối tượng Response và Request. Cho ví dụ minh hoạ. BỘ CÔNG THƯƠNG TRƯỜNG CĐ KỸ THUẬT CAO THẮNG ------------------------------------- ĐỀ 1 ĐỀ THI HỌC KỲ PHỤ - NĂM HỌC 2009-2010 MÔN : LẬP TRÌNH ỨNG DỤNG WEB 1 LỚP: CDTH07 Thời gian làm bài: 90 phút, không

More information

Khoa Công Nghệ Thông Tin Trường Đại Học Cần Thơ. Những hỗ trợ tiên tiến khác của SQL. Đỗ Thanh Nghị

Khoa Công Nghệ Thông Tin Trường Đại Học Cần Thơ. Những hỗ trợ tiên tiến khác của SQL. Đỗ Thanh Nghị Khoa Công Nghệ Thông Tin Trường Đại Học Cần Thơ Những hỗ trợ tiên tiến khác của SQL Đỗ Thanh Nghị dtnghi@cit.ctu.edu.vn Cần Thơ 24-04-2005 Nội dung 2 3 Định nghĩa kế thừa CREATE TABLE Hỗ trợ cho định nghĩa

More information

Virtual LAB Summary (CCNA Routing & Switching)

Virtual LAB Summary (CCNA Routing & Switching) Virtual LAB Summary (CCNA Routing & Switching) PHẦN 1 YÊU CẦU CƠ BA N - Xóa cấu hình, khởi động lại tất cả thiết bị với cấu hình trắng - Thiết lập sơ đồ như hình minh họa - Đặt hostname, gán địa chỉ IP

More information

Chapter 4 Menus, Functions And Common Dialog

Chapter 4 Menus, Functions And Common Dialog Chapter 4 Menus, Functions And Common Dialog Programming In C Sharp METHODS PHƯƠNG THỨC Phương thức là một tập hợp trình tự các câu lệnh thực hiện được đặt tên. Mỗi phương thức sẽ có một tên và thân phương

More information

Programmierpraktikum

Programmierpraktikum Programmierpraktikum Claudius Gros, SS2012 Institut für theoretische Physik Goethe-University Frankfurt a.m. 1 of 18 17/01/13 11:46 Java Applets 2 of 18 17/01/13 11:46 Java applets embedding Java applications

More information

MỤC LỤC. Giáo trình Thiết kế web Trang 1

MỤC LỤC. Giáo trình Thiết kế web Trang 1 NỘI DUNG MỤC LỤC TRANG LỜI NÓI ĐẦU... 3 TÀI LIỆU THAM KHẢO... 4 BÀI 1: GIỚI THIỆU TỔNG QUAN VỀ DREAMWEAVER... 5 I. GIỚI THIỆU... 5 II. CÁC THAO TÁC CĂN BẢN TRONG DREAMWEAVER... 5 III. ĐỊNH DẠNG GIAO DIỆN

More information

Time Picker trong Android

Time Picker trong Android Time Picker trong Android Time Picker trong Android cho phép bạn lựa chọn thời gian của ngày trong chế độ hoặc 24 h hoặc AM/PM. Thời gian bao gồm các định dạng hour, minute, và clock. Android cung cấp

More information

- Chạy file cài đặt: kerio-kwf-whql win32.exe. Hộp thoại Choose Setup Language chọn English (United States), chọn

- Chạy file cài đặt: kerio-kwf-whql win32.exe. Hộp thoại Choose Setup Language chọn English (United States), chọn Với nhu cầu kết nối Internet hiện nay, nếu trong hệ thống mạng của chúng ta chỉ có 1 đường truyền ADSL thì tốc độ truy cập internet có thể bị chậm do đường truyền bị quá tải, hoặc tại 1 thời điểm không

More information

Khối: Cao Đẳng nghề và Trung Cấp Năm 2009

Khối: Cao Đẳng nghề và Trung Cấp Năm 2009 Hướng Dẫn Thực Hành Lập Trình Windows Nâng Cao Khối: Cao Đẳng nghề và Trung Cấp Năm 2009 Hướng dẫn: Bài tập thực hành được chia làm nhiều Module Mỗi Module được thiết kế cho thời lượng là 3 tiết thực hành

More information

Tính kế thừa-2. Bởi: Thanh Hiền Vũ. Định nghĩa lại các thành viên lớp cơ sở trong một lớp dẫn xuất:

Tính kế thừa-2. Bởi: Thanh Hiền Vũ. Định nghĩa lại các thành viên lớp cơ sở trong một lớp dẫn xuất: Tính kế thừa-2 Bởi: Thanh Hiền Vũ Định nghĩa lại các thành viên lớp cơ sở trong một lớp dẫn xuất: Một lớp dẫn xuất có thể định nghĩa lại một hàm thành viên lớp cơ sở. Điều này được gọi là overriding. Khi

More information

HỢP ĐỒNG MUA BÁN HÀNG HÓA QUỐC TẾ GV: NGUYỄN THỊ BÍCH PHƯỢNG

HỢP ĐỒNG MUA BÁN HÀNG HÓA QUỐC TẾ GV: NGUYỄN THỊ BÍCH PHƯỢNG HỢP ĐỒNG MUA BÁN HÀNG HÓA QUỐC TẾ GV: NGUYỄN THỊ BÍCH PHƯỢNG KHÁI NIỆM & PHÂN LOẠI Hợp đồng mua bán hàng hóa quốc tế: còn được gọi là hợp đồng xuất nhập khẩu, hoặc hợp đồng mua bán ngoại thương là sự thỏa

More information

PHÁT TRIỂN ỨNG DỤNG WEB

PHÁT TRIỂN ỨNG DỤNG WEB Bài giảng PHÁT TRIỂN ỨNG DỤNG WEB Lê Đình Thanh Bộ môn Mạng và Truyền thông Máy tính Khoa Công nghệ Thông tin Trường Đại học Công nghệ, ĐHQGHN E-mail: thanhld@vnu.edu.vn, thanhld.vnuh@gmail.com Mobile:

More information

HƯỚNG DẪN SỬ DỤNG DỊCH VỤ CDN

HƯỚNG DẪN SỬ DỤNG DỊCH VỤ CDN HƯỚNG DẪN SỬ DỤNG DỊCH VỤ CDN 07/2016 MỤC LỤC I. GIỚI THIỆU VỀ DỊCH VỤ CDN II. ĐĂNG KÝ TÀI KHOẢN VÀ TẠO DỊCH VỤ CDN 1. Đăng ký Tài khoản mới 2. Tạo gói Dịch vụ mới III. IV. THIẾT LẬP DỊCH VỤ HTTP/HTTPS

More information

NHẬP MÔN LẬP TRÌNH KHOA HỌC DỮ LIỆU. Bài 10: Thư viện Pandas (2)

NHẬP MÔN LẬP TRÌNH KHOA HỌC DỮ LIỆU. Bài 10: Thư viện Pandas (2) NHẬP MÔN LẬP TRÌNH KHOA HỌC DỮ LIỆU Bài 10: Thư viện Pandas (2) Nội dung 1. Chữa bài tập buổi trước 2. Làm việc với panel 3. Chọn và nhóm phần tử 4. Sử dụng pandas trong bài toán thực tế 5. Bài tập TRƯƠNG

More information

LEECH Chưởng trình Chat bằng c# : Source :

LEECH Chưởng trình Chat bằng c# : Source : LEECH Chưởng trình Chat bằng c# : Source : http://totuan.one-forum.net/ki7871n-...ang-c-t486.htm I. Giới thiệu Chương trình cho phép thực hiện việc giao tiếp giữa các clients thông qua server, II. Nội

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 36 November 30, 2018 Mushroom of Doom Model / View / Controller Chapter 31 Announcements Game Project Complete Code Due: Monday, December 10th NO LATE

More information

Tìm hiểu Group Policy Object và các ví dụ

Tìm hiểu Group Policy Object và các ví dụ Tìm hiểu Group Policy Object và các ví dụ Các thành phần trong Group Policy Object Phần I: Computer Configuration: Windows Setting: Tại đây có thể tinh chỉnh, áp dụng các chính sách về vấn đề sử dụng tài

More information

Exam: Applet, Graphics, Events: Mouse, Key, and Focus

Exam: Applet, Graphics, Events: Mouse, Key, and Focus Exam: Applet, Graphics, Events: Mouse, Key, and Focus Name Period A. Vocabulary: Complete the Answer(s) Column. Avoid ambiguous terms such as class, object, component, and container. Term(s) Question(s)

More information

PHÁT TRIỂN ỨNG DỤNG DI ĐỘNG NÂNG CAO

PHÁT TRIỂN ỨNG DỤNG DI ĐỘNG NÂNG CAO ĐẠI HỌC QUỐC GIA THÀNH PHỐ HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC KINH TẾ - LUẬT KHOA HỆ THỐNG THÔNG TIN TS LÊ HOÀNH SỬ (Chủ biên) ThS HỒ TRUNG THÀNH ThS TRẦN DUY THANH GIÁO TRÌNH PHÁT TRIỂN ỨNG DỤNG DI ĐỘNG NÂNG

More information

1 Bước 1: Test thử kit LaunchPad.

1 Bước 1: Test thử kit LaunchPad. KHOA ĐIỆN ĐIỆN TỬ CLB NGHIÊN CỨU KHOA HỌC Tp. Hồ Chí Minh, ngày 07 tháng 04 năm 2013 HƯỚNG DẪN NẠP BOARD MAIN-MSP430 BẰNG KIT LAUNCHPAD Tài liệu này hướng dẫn cách sử dụng Kit TI MSP430 Launch Pad như

More information

Lập trình chuyên nâng cao. Lập trình phân tán (Distributed computing

Lập trình chuyên nâng cao. Lập trình phân tán (Distributed computing Mục tiêu Lập trình chuyên nâng cao Chương V Lập trình phân tán RMI Biên soạn: ThS Nguyễn Văn Lành Hoàn thành chương nầy, sinh viên phải đạt được những điểm sau: Nhận thức được các thách thức và giải pháp

More information

Giao tiếp giữa các tiến trình

Giao tiếp giữa các tiến trình Hệ điều hành Bài tập Tuần 3 1 Giao tiếp giữa các tiến trình Bài tập 1 : Một tiến trình có thể gửi tới một tiến trình khác một Signal. Các Signal phần lớn được gửi đi từ kernel khi một sự kiện xảy ra, ví

More information

LINQ TO SQL & ASP.NET

LINQ TO SQL & ASP.NET Chương 13 LINQ TO SQL & ASP.NET Sau khi học xong bài này, học viên có khả năng : - Xây dựng được ứng dụng ASP.NET tương tác với Cơ sở dữ liệu thông qua mô hình 2 tier - Sử dụng được LINQ to Object để truy

More information

Mô hình thực thi ASP.NET page Xây dựng Web Form HTML Control và Web Control Bổ sung code vào Page Page Event Life Cycle Postback event

Mô hình thực thi ASP.NET page Xây dựng Web Form HTML Control và Web Control Bổ sung code vào Page Page Event Life Cycle Postback event TỔNG QUAN VỀV ỨNG DỤNG D ASP.NET 1 Nội dung Tổng quan lập trìnhứng dụng Web Mô hình thực thi ASP.NET page Xây dựng Web Form HTML Control và Web Control Bổ sung code vào Page Page Event Life Cycle Postback

More information