Java代写Swing的JOptionPane Labelled

2019-08-25  本文已影响0人  lutongjiu

& Material CoveredString datachar dataJOptionPane input (Gold question only)NotesMake sure your TA has recorded your mark before leaving.Remember that you only need to do one of the three levels (Bronze, Silver, or Gold) to obtain 2/2 on the lab, although you are encouraged to do as many as you can.The exercises are independent and can be done in any order.Labelled dotsIn this exercise, you will draw small circles in the canvas, one per frame, and label them with the (x,y) coordinate of their centres, as shown on the right.The draw() function should generate a random (x,y) coordinate, and draw a small white circle, with a diameter of 5 pixels, with its centre at that location. Use int values, not float values, for x and y (otherwise the coordinates will not look very good when you draw them), and make sure that the x coordinate is at least 80 pixels from the right edge, and the y coordinate is at least 25 pixels from the top edge, to make sure there is room to draw the coordinates. Use a 500x500 canvas, as usual. Remember that random(a,b) can be used to get a random float value r where a≤r

上一篇 下一篇

猜你喜欢

热点阅读