Anissa Pary

Ranch Hand
+ Follow
since Jan 02, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
23
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anissa Pary

Can anyone help is there a way to set my own coordinate system in JPanel?
8 years ago

Rob Spoor wrote:The coordinate system is in pixels, so how can you draw a pixel at a location that spans to pixels?


Ok may be I wrote not correctly I need to draw a point but 1 site call points as pixels that is why I am calling them like this as well
8 years ago
Hello, I wanted to draw a pixel at position 1.6 and I am using method g.drawLine(x,y,x,y); but it needs ints in it how can I draw at position that includes floating points?
8 years ago
Hello, I have a JPanel and I want JFrame to be exactly at coordinate(10,10.5) on a JPanel how can I do that? I need a double in there if setLocation makes 2 ints...
8 years ago

Bear Bibeault wrote:Where do you want to draw this cloud? In an image file? on a desktop window? on an HTMl page? Other?


Ok, I want to draw it in JFrame(JPanel)
8 years ago

Bear Bibeault wrote:Where?


Sorry, I did not actually catch your question
8 years ago
Hello. Can anyone advise how can I draw a cloud in java? (if I have x and y coordinates of points )Thanks in advance!
8 years ago

Paul Clapham wrote:The <E> is a "type parameter"; it means the same type throughout the class which it parametrizes.


thank you!:D
8 years ago
OK Thank you! I get it that there should be
So is the same change should be for the method?

and Question number 2 how this method should know which <E> to take? CircularArrayRing<E> or AbstractCollection<E> or Ring<E> or there is no matter?
8 years ago
Can anyone help please I have an assignment

Write an CircularArrayRing<E> class which implements the Ring<T> interface and extends AbstractCollection<E>.


the code for ring

So, stupid question but still when I am doing:

It gives me an error about T saying T cannot be resolved to a type and the interface collection cannot be implemented more than once with different arguments Collection<E> and Collection<T>. but the methods inside the class must include this T.

How can I solve this problem?
8 years ago

Anissa Pary wrote:

Jeff Verdegan wrote:

Anissa Pary wrote:Sorry I have made a mistake and printed wrong stuff this six mistakes was from another program and here it is just a failure...



Okay, so, what exact errors are you getting here and on which exact lines are they occurring?


it is saying runs:6/6 errors:0 failures: 1
junit.framework.AssertionFailedError: Resizing too often (inefficient) expected: <-1> but was <13> at CircularArrayQueueTest.testResize(CircularArrayQueueTest.java:122). So, it means

in the method:

but when I am changing the value of it is still complaining and it fails only when I run the code


OK get it working now anyway thanks for looking in my code!
8 years ago

Jeff Verdegan wrote:

Anissa Pary wrote:Sorry I have made a mistake and printed wrong stuff this six mistakes was from another program and here it is just a failure...



Okay, so, what exact errors are you getting here and on which exact lines are they occurring?


it is saying runs:6/6 errors:0 failures: 1
junit.framework.AssertionFailedError: Resizing too often (inefficient) expected: <-1> but was <13> at CircularArrayQueueTest.testResize(CircularArrayQueueTest.java:122). So, it means

in the method:

but when I am changing the value of it is still complaining and it fails only when I run the code
8 years ago
Sorry I have made a mistake and printed wrong stuff this six mistakes was from another program and here it is just a failure...
8 years ago
Hello. I have 2 classes


and Test class

1 failure at resizing It says resizing too often is inefficient and resizing was done 13 times. But I don't see why. Can anyone please help!

8 years ago

Jeff Verdegan wrote:

Anissa Pary wrote:

Jeff Verdegan wrote:

Campbell Ritchie wrote:You appear to have a kind of List which does not support removals. If you look in the documentation, you find remove() is “optional”, so classes implementing List are permitted to throw such an Exception instead of removing.



And if Anissa reads the docs for the Arrays.asList() call she's using, she'll find it returns just such a List.


Anissa read docs but she did not know about optional methods



That sentence seems self-contradictory.

and she cannot use arrayList because the program fails even quicker=(



If you show your current code and provide details about exactly how and where it fails, someone can help you. Remember, ItDoesntWorkIsUseless(⇐click) and you need to TellTheDetails.(←click)

Just at a guess though, you can create a modifiable ArrayList from an unmodifiable one.



Not saying that's necessarily a proper approach, but it may get you pointed in the right direction.


So, what is contradictory about my sentence? I am new to java and never met optional methods I have read the API but skipped through (optional) cause I did not meet it and thanks to Campbell Ritchie I started to know that not all methods which are in the API are supported by classes.
and what I mean by failed when I did and I printed the values of the my list all of them were null.
However the code have the same values as my array, which was what I actually needed.

8 years ago