32 Topics
|
|
As what was stated on the header I want to implement either a "paint" or "eraser" function whichever feature more convenient for user to edit paint/censor unwanted parts of a photo displayed on a imageview before uploading it to a server in the edited format and a redo function if … |
|
i am confuse about `paint()` method in applet .The confusion is that paint method is getting object as parameter of Graphics class like this `public void paint(Graphics g)` and i read that the Graphics class is an abstract class then how we create object of Graphics class and now you … |
|
Hi. I have a JFrame with a JLayeredPane. On the first layer there is a table, then above it there is black transparent layer that allows me options and what-not. I animate the arrival of this transparent layer. However when I do this the panel seems to loose it's transparency, … |
|
import java.awt.Point; import javax.swing.*; import java.awt.Graphics; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import javax.swing.JPanel; public class painttest extends JPanel { private int pointCount = 0; private Point[] points = new Point[1000]; public painttest(){ addMouseMotionListener(new MouseMotionAdapter() {public void MouseDragged(MouseEvent event){ if(pointCount<points.length) {points[ pointCount ] = event.getPoint(); // find point ++pointCount; // increment number … |
|
Hi All, Im still finding it hard to understand Paint method, Almost all websites i had gone thru, they are showing examples of how to use it in an applet. I just cant understand on how to use it in a GUI application by extending Jframe object. Here is one … |
|
Hi All, I have a doubt in paint method of the Component Class. I know how to use that in Applet but im finding it hard to use it in GUI app. Im posting my code here, please edit it to make the program use paint method to render any … |
|
I have been looking over past exam papers for revision for an upcoming uni exam for Java and one of the questions was, asking for code to add to a given abacus program to make the grid display 3 counters in each column of a 10x6. e.g. as soon as … |
|
Hello! I am using for the first time the JTabbedPane. The problem that I have is that I want to apply the paint method only for the first tab, but it also paints the second one. How can I solve this problem? |
|
Just a simple Jython code to test drawing on the canvas. |
|
Hi, i'm making a server client piant program that send what is painted on the server to the client(and vice versa). this program is supposed to use instruction based transmission of the image. i have a server client program that sends what is drawn on the server to the client … |
|
I have this paint program and i'm having a very silly problem. I'm trying to set the paint area to west position using border layout but when i do that it doesn't show up when i run the program. if i set it in the center it shows up. everything … |
|
Hi everyone, I was writing a program to show visually some vectors I was implementing with Java but I ran into an issue. My program has 3 classes, a driver, a Vector class and a VectorDisplay. The driver and vector class are self explanatory, but here is the code. Driver: … |
|
Am trying to draw image on jpanel or jlabel when button is been click on, so i added actionperformed on my button as follows. private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: Image imag = new ImageIcon(this.getClass().getResource("img/top_bg.jpg")).getImage(); showPix1.setLayout(new BorderLayout()); showPix1.add(new paintPhotos(imag,20,20), BorderLayout.CENTER); } I have a … |
|
Ok so basically I want to know how I can paint multiple items to the screen without using all of my laptop CPU power. I was thinking that it may be possible to arrange the items as a bitmap and then paint that bitmap to the screen but im not … |
|
I have this code and I have been trying to figure it out for a while now but i cant get it to work .My basicproblem is I cant get the paint part or the programme to work properly. I have done several paint programmes in the past but i … |
|
Hi, could some one look over my code I by myself dont get where the flaw is. It should paint 1 cube at a time but now it runs all the code through and paints all at once. package net.viped; import java.awt.Color; import java.awt.Graphics; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import javax.swing.JFrame; … |
|
In a previous thread i had described a problem i had to transfer a frame or panel and all it's components as an image into a buffered image. I thought i had found the solution but it seems i am doing something wrong. In line 162 i call the method … |
|
hi, I'm currently building a game and stuck at the paintComponent method. I'm trying to add 3 graphic buttons to the JPanel but the paintComponent does not execute (all I get is gray window) here's my code : public class TwinMoonTowers extends JPanel implements ActionListener{ private class TMTMenu extends MouseAdapter{ … |
|
Hey all, I have been wanting to make a cool game in jave such as a fighting game starting off simple with drwing stick figures :). But i was wondering why there are so many java games created in Japplet why not use swing- i know there are games out … |
|
Hi, i need a source code in assembly that make paint imvironment such as windows paint...not so profetionally like that...just when i drag a shape such as rectangle and drop this, draw a big rectangle. i want execute this code in c ... thanks ... |
|
hi. i'm trying to make a program that will connect two points that i click in my JPanel. i'm trying to connect the two points with a line. i displayed the values of my (x1, y1) and (x2,y2) coordinates whenever i click using the mouse and there is no error … |
|
My objective is actually [B]extremely[/B] simple, but I just don't know how to do it. I want to put some swing components on top of graphics which fills the entire screen. That's it. And I can't figure out how to do it... Some other side-questions that I would love to … |
|
Hey guys, I have just finished a very simplistic game where the object of the game is to move out of the way of a falling block. Still only version 1 so don't expect much but your welcome to have a go and post any feedback on this thread. Looking … |
|
I am trying to load a background in full screen mode, but when i run my program the screen is just white. Can someone point me to the reason why? [CODE]import java.awt.*; import javax.swing.*; public class DrawComponents { GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice device = env.getDefaultScreenDevice(); GraphicsConfiguration gc = device.getDefaultConfiguration(); … |
|
|
I am trying to write a multi-window text editor. I have a Page Control containing 20 pages, and each page (tab sheet) contains an instance of my editor. Which works mostly ok, except I sometimes get weird results when painting my editor window. The attached code is a greatly cut-down … |
Hi all, This is my first post here so please bear with me. I am trying to get my QGraphicsView widget to output as an image. I have the following code. [CODE] def outputImg(self,dir=None): if dir == None: dir = os.getcwd() img = QtGui.QImage(self.size()) print img.isNull() # This == True … |
|
Hey here's my code for functioning like MS Paint. But JLabels are just not visible. Please Help. [CODE] import java.awt.event.*; import javax.swing.*; import java.awt.*; import java.awt.image.*; public class MSPaint { JFrame frame; JPanel panel; Painting paint = new Painting(); public MSPaint() { frame = new JFrame("MS Paint"); frame.setSize(1024,768); panel = … |
|
Hello everyone on Daniweb!:) I'm all new with working with swing and I'm having some problems making my paint method work:/. Atm I'm just tryin to make it write a ball, which I can control into different directions. Right now there is quite alot of unnecessary stuff in my code … |
|
I'm creating a silly game, and the first thing I want to make is to tell you "You Lose" if the all that you control with the mouse is not inside the frame. I created a JComponent and every 20 milliseconds it is repainted (A thread does that). Inside it, … |
|
In class my teacher ran a program similar to this one. When I attempt to run this from home I get a message saying "No main classes found". I know there should be a main in the program but he ran a similar program without it. Just trying to get … |
The End.