Public class JavaPaintUI extends javax.swing. I don't know where to put the graphics class. View DrawingPanel.java from CS PROGRAMMIN at University of Pittsburgh. panel.sleep( ms ) Pauses the drawing for the given number of milliseconds. panel.save( filename ) Saves the image on the panel to the given file (String). tWidth( width ) tHeight( height) tSize( width, height) Changes the drawing panels size to the given value(s). I need to draw inside a JPanel, inside my JFrame. Java JPanel example with topics on JButton, diifference between AWT and swing, JRadioButton, JTextField, JTextArea, JList, JColorChooser, JSlider, JMenu, JPanel. Erases any shapes that are drawn on the drawing panel. Towards the end of my code I have a failed attempt at drawing inside the panel.Ĭan anyone explain/show how to use graphics in a example like this?Īll examples I have found make a class and extend it with JPanel but I don't know if I can do this since it was generated in netbeans. If the given array's dimensions do not match the width/height of the drawing panel, the panel is resized to match the array. So, for example, index rc represents the RGB pixel data for the pixel at position (xc, yr). So far I've used Netbeans to create a GUI and set up the program.Īs of right now I am able to call all the coordinated necessary to draw inside it but I am very confused with how to actually paint inside it. The first index of the array is the y-coordinate, and the second index is the x-coordinate. I'm working on a project in which I am trying to make a paint program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |