Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have problem about array in java, what i am trying to do is when i press E it should store rr which is selectionpane

I have problem about array in java, what i am trying to do is when i press E it should store rr which is selectionpane rectangle into Listrr2 and then after press key A it should print rr2.size but it always is 1 even i press E many times. So my code does not work at all because it reassign the object in rr2 list every time i press E. I just want it continue storing the rectangle. If you have sample code pls let me know, thanks image text in transcribed
image text in transcribed
/I label.setText ("you're done"); System.out.println("you selected pane"+SelectionP); ?f (argo . getKeyCode ()--KeyEvent . vr_E) { rr select 1onPane. r; selectionPane.label.setText (rr.tostring )) rr2 = new ArrayList(); rr2.add (rr) else if (arg0.getKeyCode KeyEvent. VKA) ( selectionPane.label.setText("print test"). x-rr2.size system.out.println("this is array size: "+x): eoverride public void keyReleased (KeyEvent argo) ( / TODO Auto-generated method stub /I label.setText ("you're done"); System.out.println("you selected pane"+SelectionP); ?f (argo . getKeyCode ()--KeyEvent . vr_E) { rr select 1onPane. r; selectionPane.label.setText (rr.tostring )) rr2 = new ArrayList(); rr2.add (rr) else if (arg0.getKeyCode KeyEvent. VKA) ( selectionPane.label.setText("print test"). x-rr2.size system.out.println("this is array size: "+x): eoverride public void keyReleased (KeyEvent argo) ( / TODO Auto-generated method stub

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

Starting from Equation (20.13), show that I, / W j = Err x a j.

Answered: 1 week ago