Tuesday, February 12, 2008
finished, more or less
painting thingy is done, it has all the additions and speed I can/want to give it. I still wish it would run faster (in terms of the circles being drawn with spaces in between), but I can't think of any other way to improve, so I'm calling it done. Yay.
Sunday, February 10, 2008
missed class friday, so...
more of the same work, it's harder because I don't necessarily have all the functions memorized in terms of their syntax. It's going well, though. I giving options for color and size, hopefully without affecting the smoothness of the application.
Tuesday, January 29, 2008
Jan 29
Painter application is now up and running, it just needs polishing. I created a class to draw a circle, then had my main "paint panel" class call the "circle" class whenever the mouse was used (this creates the effect of drawing lines). I also used an ArrayList to store all previously drawn circles, so the application can quickly redraw all of them whenever it needs to.
Sunday, January 27, 2008
Jan 27
I missed class on Friday, so today I spent a while messing with Java, trying to get a "paint" style application I'm building to do what I want it to. Specifically, I'm attempting to allow the user to have options like brush size and color. I am also having some problems with one bit of code; for some reason I can't get the drawing panel to have a different background from the main frame.
As far as I know, this should give a black window with a white panel to the right side, but the panel is black too. Oh well.
public void createUserInterface()
{
// get content pane for attaching GUI components
Container contentPane = getContentPane();
// enable explicit positioning of GUI components
contentPane.setLayout( null );
contentPane.setBackground(Color.BLACK);
// set up myDrawJPanel
myDrawJPanel = new DrawJPanel2();
myDrawJPanel.setBounds( 150, 8, 350, 274 );
myDrawJPanel.setBackground(Color.WHITE);
contentPane.add( myDrawJPanel );
// set properties of application's window
setTitle( "Painter" ); // set title bar text
setSize( 516, 330 ); // set window size
setVisible( true ); // display window
} // end method createUserInterface
As far as I know, this should give a black window with a white panel to the right side, but the panel is black too. Oh well.
Thursday, January 24, 2008
Subscribe to:
Posts (Atom)