Ginar 发表于 2007-3-13 11:05:36

[发泄帖不喜勿进]100刀就这么被花掉了阿

我核算了一下,INTERNATIONAL STUDENT的总学费除以总学时,基本上结果是上一个小时课=花掉100刀……
PS 100刀这边能干什么?能让你吃大约20次M记,买几件MADE IN CHINA的衣服,交付1间小房间1周的房租,或者打车去很远的地方玩。
好吧,正题,今天上课老师让学习如何用JAVA画图,然后给个半成品让我们补充完整,结果发现该有的都没有,还得从头学Graphic,结果1小时光看参考资料了,总算明白人家写的都是什么了,课也下了……
结果去骨骼上一搜HOW TO DRAW A CIRCLE USING JAVA,马上找到了最简单解决方案:用JAVA APPLET,完整程序我5分钟就全弄出来了。
这学校真不厚道,明明可以用简单易懂的方式去处理问题,非要绕圈子,我花钱上学也不是让你这么干的阿?愤怒!



import java.awt.*;
import java.applet.*;

public class HouseshapeDrawing extends Applet
{
   public void paint(Graphics g)
   {int xCoords[] = {125,100,150};
    int yCoords[] = {10,60,60};
    Polygon triangle = new Polygon(xCoords, yCoords, 3);
    g.fillRect(100,60,50,50);
    g.fillOval(120,0,10,10);
    g.fillPolygon(triangle);
   
   }
}

KAIBA 发表于 2007-3-13 11:11:03

- -JAVA的基础,MS我最开始看那本书第二节就开始讲这个.....

apollo504 发表于 2007-3-13 11:13:35

我连C语言都苦手,JAVA就更是浮云了.....OTZ

Ginar 发表于 2007-3-13 11:15:06

自己动手丰衣足食,我们想拿平时成绩满的人都是老师没交就开始K书开始做ASSIGNMENT了,等老师全部讲完开始做的人基本都会死掉。所以我很怀疑要老师讲起多大作用,直接把参考书全A完估计也就修炼圆满了。关键这边老师还基本不答疑问,每周找个人问问题MB还要电话/EMAIL预约……

中中 发表于 2007-3-13 11:34:18

青蛙~很多基础都是要学的,高数也是要4则运算为基础的呀

Ginar 发表于 2007-3-13 11:39:58

原帖由 中中 于 2007-3-13 11:34 发表 http://bbs.newwise.com/images/common/back.gif
青蛙~很多基础都是要学的,高数也是要4则运算为基础的呀
关键他给的那个STUB不是基础,是从复杂程序中拿出一块让你用的,具体说也不清楚,反正不符合我直接设计的思路,绕圈子好多阿。
不正学APPLET基础么,我就不信我另起炉灶还做不出来了。

PS.我们老师写的程序,让你用这个套,我看半天还是没干出来,怒了直接换APPLET。
中哥是强人俺是知道的,赶明我的小组ASSIGNMENT还可以问你=口=V

import javax.swing.*;
import java.awt.*;
import java.util.List;
import java.util.*;
/**
* Canvas is a class to allow for simple graphical drawing on a canvas.
* This is a modification of the general purpose Canvas, specially made for
* the BlueJ "shapes" example.
*
* @author: Bruce Quig
* @author: Michael Kolling (mik)
*
* @version: 1.6 (shapes)
*/
public class Canvas
{
    // Note: The implementation of this class (specifically the handling of
    // shape identity and colors) is slightly more complex than necessary. This
    // is done on purpose to keep the interface and instance fields of the
    // shape objects in this project clean and simple for educational purposes.
private static Canvas canvasSingleton;
/**
* Factory method to get the canvas singleton object.
*/
public static Canvas getCanvas()
{
if(canvasSingleton == null) {
   canvasSingleton = new Canvas("BlueJ Shapes Demo", 300, 300,
         Color.white);
}
canvasSingleton.setVisible(true);
return canvasSingleton;
}
//----- instance part -----
    private JFrame frame;
    private CanvasPane canvas;
    private Graphics2D graphic;
    private Color backgroundColour;
    private Image canvasImage;
    private List objects;
    private HashMap shapes;
   
    /**
   * Create a Canvas.
   * @param titletitle to appear in Canvas Frame
   * @param widththe desired width for the canvas
   * @param heightthe desired height for the canvas
   * @param bgClourthe desired background colour of the canvas
   */
    private Canvas(String title, int width, int height, Color bgColour)
    {
      frame = new JFrame();
      canvas = new CanvasPane();
      frame.setContentPane(canvas);
      frame.setTitle(title);
      canvas.setPreferredSize(new Dimension(width, height));
      backgroundColour = bgColour;
      frame.pack();
      objects = new ArrayList();
      shapes = new HashMap();
    }
    /**
   * Set the canvas visibility and brings canvas to the front of screen
   * when made visible. This method can also be used to bring an already
   * visible canvas to the front of other windows.
   * @param visibleboolean value representing the desired visibility of
   * the canvas (true or false)
   */
    public void setVisible(boolean visible)
    {
      if(graphic == null) {
            // first time: instantiate the offscreen image and fill it with
            // the background colour
            Dimension size = canvas.getSize();
            canvasImage = canvas.createImage(size.width, size.height);
            graphic = (Graphics2D)canvasImage.getGraphics();
            graphic.setColor(backgroundColour);
            graphic.fillRect(0, 0, size.width, size.height);
            graphic.setColor(Color.black);
      }
      frame.setVisible(visible);
    }
    /**
   * Draw a given shape onto the canvas.
   * @paramreferenceObjectan object to define identity for this shape
   * @paramcolor            the color of the shape
   * @paramshape            the shape object to be drawn on the canvas
   */
   // Note: this is a slightly backwards way of maintaining the shape
   // objects. It is carefully designed to keep the visible shape interfaces
   // in this project clean and simple for educational purposes.
    public void draw(Object referenceObject, String color, Shape shape)
    {
   objects.remove(referenceObject);   // just in case it was already there
   objects.add(referenceObject);      // add at the end
   shapes.put(referenceObject, new ShapeDescription(shape, color));
   redraw();
    }

    /**
   * Erase a given shape's from the screen.
   * @paramreferenceObjectthe shape object to be erased
   */
    public void erase(Object referenceObject)
    {
   objects.remove(referenceObject);   // just in case it was already there
   shapes.remove(referenceObject);
   redraw();
    }
    /**
   * Set the foreground colour of the Canvas.
   * @paramnewColour   the new colour for the foreground of the Canvas
   */
    public void setForegroundColor(String colorString)
    {
if(colorString.equals("red"))
   graphic.setColor(Color.red);
else if(colorString.equals("black"))
   graphic.setColor(Color.black);
else if(colorString.equals("blue"))
   graphic.setColor(Color.blue);
else if(colorString.equals("yellow"))
   graphic.setColor(Color.yellow);
else if(colorString.equals("green"))
   graphic.setColor(Color.green);
else if(colorString.equals("magenta"))
   graphic.setColor(Color.magenta);
else if(colorString.equals("white"))
   graphic.setColor(Color.white);
else
   graphic.setColor(Color.black);
    }
    /**
   * Wait for a specified number of milliseconds before finishing.
   * This provides an easy way to specify a small delay which can be
   * used when producing animations.
   * @parammillisecondsthe number
   */
    public void wait(int milliseconds)
    {
      try
      {
            Thread.sleep(milliseconds);
      }
      catch (Exception e)
      {
            // ignoring exception at the moment
      }
    }
/**
* Redraw ell shapes currently on the Canvas.
*/
private void redraw()
{
erase();
for(Iterator i=objects.iterator(); i.hasNext(); ) {
            ((ShapeDescription)shapes.get(i.next())).draw(graphic);
      }
      canvas.repaint();
    }
      
    /**
   * Erase the whole canvas. (Does not repaint.)
   */
    private void erase()
    {
      Color original = graphic.getColor();
      graphic.setColor(backgroundColour);
      Dimension size = canvas.getSize();
      graphic.fill(new Rectangle(0, 0, size.width, size.height));
      graphic.setColor(original);
    }

    /************************************************************************
   * Inner class CanvasPane - the actual canvas component contained in the
   * Canvas frame. This is essentially a JPanel with added capability to
   * refresh the image drawn on it.
   */
    private class CanvasPane extends JPanel
    {
      public void paint(Graphics g)
      {
            g.drawImage(canvasImage, 0, 0, null);
      }
    }
   
    /************************************************************************
   * Inner class CanvasPane - the actual canvas component contained in the
   * Canvas frame. This is essentially a JPanel with added capability to
   * refresh the image drawn on it.
   */
    private class ShapeDescription
    {
   private Shape shape;
   private String colorString;
public ShapeDescription(Shape shape, String color)
   {
      this.shape = shape;
      colorString = color;
   }
public void draw(Graphics2D graphic)
{
   setForegroundColor(colorString);
   graphic.fill(shape);
}
    }
}

戒音宝贝 发表于 2007-3-13 11:43:31

100刀可以买件DIOR过季的打折牛仔裤 可以买瓶正价的chanel 可以染个头发 可以一个人去去温泉(住宿可能还不够)

Ginar 发表于 2007-3-13 11:47:18

原帖由 戒音宝贝 于 2007-3-13 11:43 发表 http://bbs.newwise.com/images/common/back.gif
100刀可以买件DIOR过季的打折牛仔裤 可以买瓶正价的chanel 可以染个头发 可以一个人去去温泉(住宿可能还不够)
我那都是衣食住行的基本需求,你这都是奢侈消费,人跟人咋就这么不一样一一?
BS阿BS

戒音宝贝 发表于 2007-3-13 12:13:00

-_- 我也是衣食住行阿 你BS我 我还BS你花美刀呢
那100刀可以两个人去威斯汀吃自助
可以买件春装衬衫 还多点钱
可以开个两个人的最便宜的温泉房
可以坐打折飞机票来回上海北京

苍月草 发表于 2007-3-13 12:53:18

吉娜,你还学java?偶记得你不是读的那个啥么...

夕影鸟 发表于 2007-3-13 12:54:32

青蛙你到底是学啥的- -不是文科么

中中 发表于 2007-3-13 13:01:50

很清楚的记得青蛙是文科呀

assault 发表于 2007-3-13 13:04:30

事实是,你们都被骗了- -

Ginar 发表于 2007-3-13 13:10:30

谁告诉你们我学文科的,顺便,JAVA已经学过一个学期了,也算入门了吧,现在只要能利用网络材料基本能照猫画虎,正在做大作业,设计超市出纳系统……

在中国光学C++了没JAVA什么事。

在风中中风 发表于 2007-3-13 13:36:44

我一年48学时,要16000刀,我也想放火烧学校啊~~~~~~

assault 发表于 2007-3-13 13:49:57

牛以前不是专做商场专柜的收钱系统的么

xliz 发表于 2007-3-13 14:34:25

原帖由 在风中中风 于 2007-3-13 15:36 发表 http://bbs.newwise.com/images/common/back.gif
我一年48学时,要16000刀,我也想放火烧学校啊~~~~~~
学分吧?一年才上48个小时的话,你学校老早就被别人烧掉了~

在风中中风 发表于 2007-3-13 14:48:48

原帖由 xliz 于 2007-3-13 14:34 发表 http://bbs.newwise.com/images/common/back.gif

学分吧?一年才上48个小时的话,你学校老早就被别人烧掉了~
啊,口误,作为穷人希望今年申请奖学金能成功,买个PS3,然后当场砸掉。

原始恶魔 发表于 2007-3-13 19:28:47

LZ要想到我的头像等先辈,那时候他们只有更苦

戒音宝贝 发表于 2007-3-13 20:56:05

kao 我30学时只收3200RMB!来跟我学吧
页: [1] 2
查看完整版本: [发泄帖不喜勿进]100刀就这么被花掉了阿