Drawing Rectangles and Lines
Hello , I am trying to solve a problem and i dont know how to do it.
I need to draw 2 kinds of rectangles one normal and lines. Rectangles should be connected with lines , you cant draw lines without being connected with rectangles. This is done.But i need to create another button that , wehn i click in the rectangle creates a text area where you can write code. I created this but when i try to create another tectangle , text area dissapeares and when i try to clear the screen text area remains there. Can You help me?
another question , of course if u can , i want to see a small implementation of the JTextArea class , basicly i want to have my own class jtextarea , i tried to do it myself , like i did with the rectangles but it didnt work it out. Thank in advance
Re: Drawing Rectangles and Lines
Code you post should be in the form of an SSCCE. What you posted is way too much for anybody else to go through. Boil it down to the bare minimum.
You should also always use the code tags to preserve formatting.
Re: Drawing Rectangles and Lines
Actually i cant different because they are all related , so if i give you the main class you will need the rest of the classes...
Re: Drawing Rectangles and Lines
anyway , the idea is how you can draw rectangles using mouse events with the option of putting text inside. This is the main task. i am pleased only with that if u cant read what i post.
Re: Drawing Rectangles and Lines
What you just described is at least 4 or 5 different individual problems, and each should have its own SSCCE. Work on each problem separately, and don't even think of combining them until you have each one working perfectly.
Re: Drawing Rectangles and Lines
let me explain you exactly what is working and not, i have 4 buttons , one for drawing rectangles , other for drawing lines , other for clear all the rectangles and lines and other fro drawing text inside rectangles.I draw first rectangles and lines but when i change the button , drawing text, it draws text but when i change the button to dtraw another rectangle then the textarea dissapear and if i press the clear button to clear all , it still remains there...
this is the main class from where i call the rest.
class Rectanglet
declaration
Code :
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Color;
import java.awt.Event;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.TextArea;[/QUOTE]
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.util.Vector;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea
public class RectangleTest extends FrameSet
{
//Line s;
//Oval o;
Line l;
Rectanglet r;
//Rectangle1 r2;
JTextArea a;
Point startpos, endpos; //Declare the start and end positions
static int check;
Button btnLine, btnRect,btnClear, btnAddText;
static Point pct;
Vector vt = new Vector(); //Vector for storing the shapes
Vector vtLines = new Vector();
Vector vtRect = new Vector();
Vector vtLine = new Vector();
Vector vtText = new Vector();
int i = 0; //Vector index to keep count of elements(i.e.shapes)
int j = 0;
int m = 0;
int n = 0;
int nheight1, nwidth1;
boolean bline = false; //booleans to know which button was
boolean bText = false;
boolean brect = false;
Methods
PHP Code:
public void RecrangleTest()
{
//Do nothing in the constructor of the applet
}
public void init()
{
setLayout(new FlowLayout());
//Create and Add the buttons
btnLine = new Button("Line");
btnAddText = new Button("AddText");
btnRect = new Button("Rectangle");
btnClear = new Button("Clear");
add(btnLine);
add(btnAddText);
add(btnRect);
add(btnClear);
}
public void paint(Graphics g)
{
Boolean drawBool = false;
int count = 0;
//To get a shadow effect
g.setColor(Color.black);
g.fillRect(0,0,size().width,size().height);
g.setColor(new Color(255,255,154));
g.fillRect(1,1,size().width-3,size().height-3);
for (int t = 0; t < vt.size(); t++)
{
//Add the shapes to the vector
Rectanglet sh = (Rectanglet)vt.elementAt(t); //elementAt(i);
sh.Draw(g);
// drawBool=true;
}
/* for(int a=0;a<vtLine.size();a++)
{
Line lines = (Line)vtLine.elementAt(a);
lines.Draw(g);
}
*/
for(int k = 0;k < vtLines.size();k++)
{
Line lines = (Line)vtLines.elementAt(k);
lines.Draw(g);
}
for(int k =0 ;k < vtText.size();k++)
{
JTextArea jtext= (JTextArea)vtText.elementAt(k);
jtext.setVisible(true);
// jtext.paint(g);
}
}
public void repaint2(){
repaint();
for(int k =0 ;k < vtText.size();k++)
{
JTextArea jtext= (JTextArea)vtText.elementAt(k);
jtext.setVisible(true);
// jtext.paint(g);
}
}
@Override
public boolean action(Event e, Object o)
{
//See which button was clicked and
//set flags accordingly
if(e.target.equals(btnAddText))
{
bline = false;
brect = false;
bText = true;
//!!!!!
}
if (e.target.equals(btnLine))
{
bline = true;
brect = false;
bText = false;
}
if (e.target.equals(btnRect))
{
bline = false;
bText = false;
brect = true;
}
if (e.target.equals(btnClear))
{
//Clear the entire drawing screen
//First remove all elements
vt.removeAllElements();
vtLines.removeAllElements();
vtText.removeAllElements();
// then make vector index zero
i =0;
j= 0;
m = 0;
n = 0;
// a.setVisible(false);
// a.removeAll();
//finally, call repaint()
// remove(a);
repaint();
remove(a);
}
repaint2();
return true;
}
Still methods but here are just Mouse events
PHP Code:
public boolean mouseUp(Event evt, int x, int y)
{
//Fianlly the mouse is up indicating shape drawing is over.
//So set these mouseUp coordinates to set the end position.
//Then update the Vector count.
endpos = new Point(x,y);
if(bText)
{
for(int t = 0;t <vt.size();t++)
{
Rectanglet rect = (Rectanglet)vt.elementAt(t);
if((startpos.x - rect.getStart().x > 0)&& (startpos.x - rect.getEnd().x < 0)&&(startpos.y - rect.getEnd().y < 0)&&(startpos.y - rect.getStart().y > 0))
{
// Rectangle rect1 = new Rectangle(rect.getStart().x + 2, rect.getStart().y + 2 , rect.getHeight()/3, rect.getHeight()/3);
JTextArea a = new JTextArea();
// textArea.setBounds(rect.x+rect.width/4, rect.y + rect.width/4, rect.width/2, rect.height/2);
//textArea.setBorder();
// Rectangle rec = new Rectangle(rect.getStart().x + rect.getHeight()/4, rect.getStart().y + rect.getHeight()/4 , rect.getHeight()/2, rect.getHeight()/2);
//a.setBounds(rect1);
a.setBounds(rect.getStart().x + 2, rect.getStart().y + 2 , rect.getHeight()/3, rect.getHeight()/3);
// Rectanglet rect2 = new Rectanglet(rect.getStart().x + 3, rect.getStart().y + 3 , rect.getHeight()/3, rect.getHeight()/3);
a.setLineWrap(true);
a.requestFocusInWindow();
a.setEditable(true);
// a.setVisible(true);
add(a);//za text area doar cand largesti imaginea
a.setCaretColor(Color.white);
a.setVisible(true);
//a.gett
///////vtText.add(m, a.getText());
vtText.add(m, a);
// vtRect.add(n, rect2);
m++;
// n++;
}
}
}
if(bline)
{
for(int s=0;s<vt.size();s++)
{
if(s!=check)
{
Rectanglet rect = (Rectanglet)vt.elementAt(s);
if((endpos.x - rect.getStart().x > 0)&& (endpos.x - rect.getEnd().x < 0)&&(endpos.y - rect.getEnd().y < 0)&&(endpos.y - rect.getStart().y > 0) )
{
// check = s;
//Point newstart = new Point(startpos.x, startpos.y);
// Point drawStop = new Point(endpos.x, endpos.y);
// l.setStart(newstart); de ce setam de 2 ori startul liniei?
l.setEnd(endpos);
vtLines.addElement(l);
l = (Line)vtLines.elementAt(j);
// vtLine.add(j, l);
j++;
}
}
}
}
if (brect)
{
Point drawto = new Point( Math.max(x,startpos.x),Math.max(y,startpos.y));
Point newstart = new Point(Math.min(x,startpos.x),Math.min(y,startpos.y));
Point PointS = newstart;
Point PointF = drawto;
r = (Rectanglet)vt.elementAt(i);
r.setWidth(drawto,newstart);
r.setHeight(drawto, newstart);
r.setEnd(drawto);
r.setStart(newstart);
i++;
}
repaint2();
return true;
}
public boolean mouseDown(Event evt, int x, int y)
{
startpos = new Point(x,y);
if(bline)
{
for(int s=0;s<vt.size();s++)
{
Rectanglet rect = (Rectanglet)vt.elementAt(s);
if((startpos.x - rect.getStart().x > 0)&& (startpos.x - rect.getEnd().x < 0)&&(startpos.y - rect.getEnd().y < 0)&&(startpos.y - rect.getStart().y > 0) )
{
check = s;
// pct = startpos;
l = new Line();
l.setStart(startpos);
// vtLines.addElement(l);
}
}
}
if (brect)
{
r = new Rectanglet(); //Create the shape - Rectangle
r.setStart(startpos);//Set the start position where mouse went down
vt.addElement(r); //and add the shape (Rectangle) to the vector vt
// vtStartPos.addElement(startpos);
}
if(bText)
{
for(int t = 0;t <vt.size();t++)
{
Rectanglet rect = (Rectanglet)vt.elementAt(t);
if((startpos.x - rect.getStart().x > 0)&& (startpos.x - rect.getEnd().x < 0)&&(startpos.y - rect.getEnd().y < 0)&&(startpos.y - rect.getStart().y > 0))
{
// RectangleText rect1 = new RectangleText();
JTextArea a = new JTextArea();
// textArea.setBounds(rect.x+rect.width/4, rect.y + rect.width/4, rect.width/2, rect.height/2);
//textArea.setBorder();
// Rectangle rec = new Rectangle(rect.getStart().x + rect.getHeight()/4, rect.getStart().y + rect.getHeight()/4 , rect.getHeight()/2, rect.getHeight()/2);
//a.setBounds(rect1);
a.setBounds(rect.getStart().x + 2, rect.getStart().y + 2 , rect.getHeight(), rect.getHeight());
// Rectanglet rect2 = new Rectanglet(rect.getStart().x + 3, rect.getStart().y + 3 , rect.getHeight()/3, rect.getHeight()/3);
// JScrollPane scrollingResult = new JScrollPane(a);
//content.add(scrollingResult);
// JPanel content = new JPanel();
//content.setLayout(new BorderLayout());
// add(scrollingResult);
a.setLineWrap(true);
a.requestFocusInWindow();
a.setEditable(true);
// a.setVisible(true);
add(a);//za text area doar cand largesti imaginea
a.setCaretColor(Color.white);
a.setVisible(true);
//vtText.add(m, a.getText());
vtText.add(m, a);
// vtRect.add(n, rect2);
}
}
}
repaint2();
return true;
}
public boolean mouseDrag(Event evt, int x, int y)
{
//Boolean okrect=false;
//Now the mouse is being dragged without releasing,
//which means that the user may stop his mouse over a
//point but not release it. So that point is the
//current endpoint
endpos = new Point(x,y);
if(bline)
{
for(int s=0;s<vt.size();s++)
{
if(s!=check){
Rectanglet rect = (Rectanglet)vt.elementAt(s);
//if((startpos.x - rect.getStart().x > 0)&& (startpos.x - rect.getEnd().x < 0)&&(startpos.y - rect.getEnd().y < 0)&&(startpos.y - rect.getStart().y > 0))
//{
if((endpos.x - rect.getStart().x > 0)&& (endpos.x - rect.getEnd().x < 0)&&(endpos.y - rect.getEnd().y < 0)&&(endpos.y - rect.getStart().y > 0) )
{
Point newstart = new Point(startpos.x, startpos.y);
//Point drawStop = new Point(endpos.x, endpos.y);
//l = (Line)vtLines.elementAt(j); ///era i inainte
l.setStart(newstart);
//l.setEnd(drawStop);
//j++; //era i inainte
}
}
//}
}
}
if (brect)
{
Point drawto = new Point( Math.max(x,startpos.x),Math.max(y,startpos.y));
Point newstart = new Point(Math.min(x,startpos.x),Math.min(y,startpos.y));
// nwidth1 = Math.abs((drawto.x - newstart.x));
//nheight1 = Math.abs((drawto.y - newstart.y));
//r = (Rectanglet)vt.elementAt(i);
r.setWidth(drawto, newstart);
r.setHeight(drawto, newstart);
r.setEnd(drawto);
r.setStart(newstart);
// vtStartPos.addElement(newstart);
// vtEndPos.addElement(drawto);
// i++;
// okrect=true;
}
repaint2();
return true;
}
}
Class Rectangle
PHP Code:
C
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
class Rectanglet extends Object
{
private int length;
private int width;
public Point ptStart; //Start point of shape
public Point ptEnd; //End point of shape
// public int width; //Width of shape
public int height;
public Color clrFront;
void Draw(Graphics g)
{
g.setColor(Color.blue.brighter()); //Set default color
g.drawRect(ptStart.x, ptStart.y, width, height);
}
public Rectanglet(int x, int y, int w, int h)
{
//ptStart = new Point();
//ptEnd = new Point();
this.ptStart.x = x;
this.ptStart.y = y;
this.width = w;
this.height = h;
}
public Rectanglet()
{
clrFront = Color.red;
}
Boolean containes(Point p)
{
if((ptStart.x - p.x < 0)&& (ptEnd.x - p.x > 0)&&(p.y - ptStart.y > 0)&&(p.y - ptEnd.y < 0))
{
return true;
}
else
return false;
}
public Rectanglet getbounds()
{
return new Rectanglet(ptStart.x, ptStart.y, width, height);
// return new Rectanglet(x1,x2,x3, x4);
}
void setStart(Point ptStart)
{
this.ptStart = ptStart;
}
void setEnd(Point ptEnd)
{
this.ptEnd = ptEnd;
}
Point getStart()
{
return ptStart;
}
int getHeight()
{
return height;
}
public double getWidth(){
return width;
}
public void setWidth(Point P1, Point P2){
this.width = Math.abs(P1.x - P2.x);
}
public void setHeight(Point P1, Point P2)
{
this.height = Math.abs(P1.y - P2.y);
}
Point getEnd()
{
return ptEnd;
}
}
//Drawing routine
Sorry but i dont know how to do it more than this. If u need the other classes let me know. I did my best. If its not ok tell how i must do and i will
Re: Drawing Rectangles and Lines
Again, that's not an SSCCE, and you didn't even bother to use the code tags. I'd love to help, but I don't have time to wade through unformatted code that isn't easy to run. You aren't going to get help if you continue down this road.
Re: Drawing Rectangles and Lines
I modified the text as i could...see up
Re: Drawing Rectangles and Lines
TL;DR.
I second Kevin's recommendation. Split your problem into individual parts and tackle each one separately. That way, if you get stuck in one part, you have a SSCCE that's short enough for people here to read and offer advice.
Or keep hoping some sucker will put in the effort that you should. It's your choice.
db
Re: Drawing Rectangles and Lines
my friends how can i split it if you need at least to know about the classes. Another try....
First i dont know where is the problem. because i dont know how to do it.
Maybe you didnt understand my problem. I dont know how to do that and dont know where is the problem.
I tried to do it like this
when i put the mouse down , at mouseDown i did something like this:
I create my own class rectanglet everything is working but text, because when i click on the trectangle the text area doesnt display all , just a small part and after i enter some text it appears aand the rest but when i tried to change the button because i have buttons for every draw(rectangle , line, clear_all and text) the text dissapears. First i want to know how to save the text and draw it every time i change the shape.
More if i try to delete all the shapes including the JTextArea the textarea reamins there.
Declration variables and stuff
PHP Code:
public class RectangleTest extends FrameSet
{
//Line s;
//Oval o;
Line l;
Rectanglet r;
//Rectangle1 r2;
JTextArea a;
Point startpos, endpos; //Declare the start and end positions
static int check;
Button btnLine, btnRect,btnClear, btnAddText;
static Point pct;
Vector vt = new Vector(); //Vector for storing the shapes
Vector vtLines = new Vector();
Vector vtRect = new Vector();
Vector vtLine = new Vector();
Vector vtText = new Vector();
int i = 0; //Vector index to keep count of elements(i.e.shapes)
int j = 0;
int m = 0;
int n = 0;
int nheight1, nwidth1;
boolean bline = false; //booleans to know which button was
boolean bText = false;
boolean brect = false;
And the paint function
PHP Code:
public void paint(Graphics g)
{
Boolean drawBool = false;
int count = 0;
//To get a shadow effect
g.setColor(Color.black);
g.fillRect(0,0,size().width,size().height);
g.setColor(new Color(255,255,154));
g.fillRect(1,1,size().width-3,size().height-3);
for (int t = 0; t < vt.size(); t++)
{
//Add the shapes to the vector
Rectanglet sh = (Rectanglet)vt.elementAt(t); //elementAt(i);
sh.Draw(g);
// drawBool=true;
}
for(int k = 0;k < vtLines.size();k++)
{
Line lines = (Line)vtLines.elementAt(k);
lines.Draw(g);
}
for(int k =0 ;k < vtText.size();k++)
{
JTextArea jtext= (JTextArea)vtText.elementAt(k);
jtext.setVisible(true);
// jtext.paint(g);
}
}
MouseDown event
PHP Code:
for(int t = 0;t <vt.size();t++)
{
Rectanglet rect = (Rectanglet)vt.elementAt(t);
if((startpos.x - rect.getStart().x > 0)&& (startpos.x - rect.getEnd().x < 0)&&(startpos.y - rect.getEnd().y < 0)&&(startpos.y - rect.getStart().y > 0))
{
// RectangleText rect1 = new RectangleText();
a = new JTextArea();
a.setLineWrap(true);
a.requestFocusInWindow();
a.setEditable(true);
add(a);
a.setCaretColor(Color.white);
a.setVisible(true);
//vtText.add(m, a.getText());
// vtText.add(a);
}
}
}
in the next mouse event
mouseUp i tried to save it in a vector
PHP Code:
for(int t = 0;t <vt.size();t++)
{
Rectanglet rect = (Rectanglet)vt.elementAt(t);
if((startpos.x - rect.getStart().x > 0)&& (startpos.x - rect.getEnd().x < 0)&&(startpos.y - rect.getEnd().y < 0)&&(startpos.y - rect.getStart().y > 0))
{
a.setLineWrap(true);
a.requestFocusInWindow();
a.setEditable(true);
add(a);//za text area doar cand largesti imaginea
a.setCaretColor(Color.white);
a.setVisible(true);
vtText.add(m, a);
m++;
// n++;
}
}
Re: Drawing Rectangles and Lines
So in the end someone will help me or not?? I want to know if i lose my time here, because i kind of have a deadline. If not ok , i will leave.
Re: Drawing Rectangles and Lines
Quote:
Originally Posted by
andreizeus
So in the end someone will help me or not?? I want to know if i lose my time here, because i kind of have a deadline. If not ok , i will leave.
You've been told what you need to do to get help. That's going to be the case no matter where you go, unless you're paying for a professional tutor. Whether or not you're willing to put forth that effort is up to you.
If you read the SSCCE link, you'll see that we're not asking for this just for our benefit. The process of creating an SSCCE is a crucial skill to pick up, even if you do it without really thinking about it.
Re: Drawing Rectangles and Lines
ok man , i will explain like i do for a kid.
I must be able to put comment box inside rectangles , rectangles created from mouse events and stored in a vector, with my own class rectangle. How can i do this?, Because when i paint it all dont work.
here is the paint function
PHP Code:
public void paint(Graphics g)
{
Boolean drawBool = false;
int count = 0;
//To get a shadow effect
g.setColor(Color.black);
g.fillRect(0,0,size().width,size().height);
g.setColor(new Color(255,255,154));
g.fillRect(1,1,size().width-3,size().height-3);
for (int t = 0; t < vt.size(); t++)
{
//Add the shapes to the vector
Rectanglet sh = (Rectanglet)vt.elementAt(t); //elementAt(i);
sh.Draw(g);
// drawBool=true;
}
for(int k = 0;k < vtLines.size();k++)
{
Line lines = (Line)vtLines.elementAt(k);
lines.Draw(g);
}
for(int k =0 ;k < vtText.size();k++)
{
JTextArea jtext= (JTextArea)vtText.elementAt(k);
jtext.setVisible(true);
// jtext.paint(g);
}
}
the format is more than SSCCE.
Re: Drawing Rectangles and Lines
Quote:
Originally Posted by
andreizeus
ok man , i will explain like i do for a kid.
And so will I: You aren't going to get help until you create an SSCCE and ask a specific question about the specific part of the problem you're stuck on. We can't really answer general "how do I do this" type questions except to point you to the basic tutorials. Go through them.
Quote:
Originally Posted by
andreizeus
I must be able to put comment box inside rectangles , rectangles created from mouse events and stored in a vector, with my own class rectangle. How can i do this?, Because when i paint it all dont work.
Which part of that are you having trouble with? Post an SSCCE that demonstrates that specific part. Is it the Mouse Event part? The drawing part? The storing of data? Creating your own class? Getting typed input? Storing typed input? Drawing typed input? Pick one to start with. Create an SSCCE.
Quote:
Originally Posted by
andreizeus
the format is more than SSCCE.
No. It's less.
Re: Drawing Rectangles and Lines
Re: Drawing Rectangles and Lines
I dont know, thats the problem, what you dont understand...i save it in the vectors but when i try to display them in paint it doesnt work. they dissapear.
Re: Drawing Rectangles and Lines
i save it in vector in mouse up
PHP Code:
if(bText)
{
for(int t = 0;t <vt.size();t++)
{
Rectanglet rect = (Rectanglet)vt.elementAt(t);
if((startpos.x - rect.getStart().x > 0)&& (startpos.x - rect.getEnd().x < 0)&&(startpos.y - rect.getEnd().y < 0)&&(startpos.y - rect.getStart().y > 0))
{
a.setBounds(rect.getStart().x + 2, rect.getStart().y + 2 , rect.getHeight()/3, rect.getHeight()/3);
a.setLineWrap(true);
a.requestFocusInWindow();
a.setEditable(true);
add(a);//za text area doar cand largesti imaginea
a.setCaretColor(Color.white);
a.setVisible(true);
vtText.add(m, a);
m++;
}
}
}
mouse down the same but a little bit different
PHP Code:
if(bText)
{
for(int t = 0;t <vt.size();t++)
{
Rectanglet rect = (Rectanglet)vt.elementAt(t);
if((startpos.x - rect.getStart().x > 0)&& (startpos.x - rect.getEnd().x < 0)&&(startpos.y - rect.getEnd().y < 0)&&(startpos.y - rect.getStart().y > 0))
{
a.setBounds(rect.getStart().x + 2, rect.getStart().y + 2 , rect.getHeight(), rect.getHeight());
a.setLineWrap(true);
a.requestFocusInWindow();
a.setEditable(true);
// a.setVisible(true);
add(a);//za text area doar cand largesti imaginea
a.setCaretColor(Color.white);
a.setVisible(true);
//vtText.add(m, a.getText());
vtText.add(m, a);
// vtRect.add(n, rect2);
}
}
}
but in the end its not working, in paint i do something like this
PHP Code:
for(int i = 0; i <vtText.size())
{
JTextArea jtext = (JTextArea)vtText.elementAt(i);
jtext.setVisible(true);
}
Re: Drawing Rectangles and Lines
Thankx for your help!!! You are supposed to be experts but as far as i read...better without!. Let me explain you someting, i am not a newbie on programming so i know what you need to do it ,and in the end after all the commentaries i understood what you know and how you manage things.I made a big mistake asking for help. Good day, Andrei
Re: Drawing Rectangles and Lines
I take it you won't be back, then? Good riddance.
db
Re: Drawing Rectangles and Lines
Quote:
Thankx for your help!!! You are supposed to be experts but as far as i read...better without!. Let me explain you someting, i am not a newbie on programming so i know what you need to do it ,and in the end after all the commentaries i understood what you know and how you manage things.I made a big mistake asking for help. Good day, Andrei
andreizeus, these members are trying to help, all on their own time without pay, and without a short and clear question it makes that effort to help difficult. You have a lot of code there with quite a few behaviors on top which may not be necessary to the problem at hand, which makes it even more difficult for those on our side to help. I suggest if you wish to get more constructive feedback, you read the first few responses to your original post - strip many of those behaviors and items out of your code and focus on the exact problem at hand: if you say 'they disappear', then remove every other component you paint except those that disappear, remove all the mouse listeners, and see what happens. If they still 'disappear', remove more. When they 'appear', slowly add all those back.
Re: Drawing Rectangles and Lines
Finally someone answered pointing something, yeah i tried everything after deep search i find out it was the JTextArea class program , everytime i was drawing the rectangle in the paint function it seems that it was painting the color after the color of the jtextarea ...So after using only TextArea or String it worked. So thankx a lot for trying to give me and advice. I go pissed off because all the time they ask for stupid SSCCE, but they even didnt try to see wtf is happening there. i marked the code with php tags and nothing...So in the end i got very angry because i am sick of the programmers that they say they know and they dont. If you know how to do it than fucking do it not ask for stupid SSCE , because i know better than them what they needed. I gave them the all code , all they should have done was to copy paste it... So in the end i got very angry.Thankx
Re: Drawing Rectangles and Lines
And for posterity's sake, I just got this gem in my private inbox from andreizeus:
Quote:
Dont try to scream and say that you tried to do something because you didnt give me any advice. I know something in my life , i know i talk , i dont i shut up. I gave you the all code , all you should have done is just to copy paste it and then i told you what i want to do the code with the mention that i have no idea why it isnt working. So shut up and next time if will ever post something here , because i dont think i will ever, talk if you know. Dont waste my time and your time too.
Yikes.