Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

22%
+0 −5
Q&A Why I am unable to find a class after implementing library also?

I had found a better way to plot in Java. int n = Integer.parseInt(args[0]); // the function y = sin(4x) + sin(20x), sampled at n+1 points // between x = 0 and x = pi ...

0 answers  ·  posted 2y ago by Anonymous‭  ·  edited 2y ago by Anonymous‭

Question java package
#6: Post edited by user avatar Anonymous‭ · 2021-10-01T04:43:19Z (over 2 years ago)
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • ![No Project Structure](https://imgur.com/dSj7GGr.png)
  • What!! I can't see any project structure option in netbeans. Ohh They had wrote the answer for IntelliJ. But I am using Netbeans. Even I don't have any file called `/lib`. I know that I have to put a line in gradle.build
  • ```gradle
  • implementation 'file_name'
  • ```
  • But I don't have any idea where I should put that jar file. I have created a folder called libs and pasted that jar file there. Then added the line to gradle.build
  • ```gradle
  • implementation fileTree(dir: 'libs', include: ['*.jar'])
  • ```
  • I have re-sync my project. Although I can't find that StdDraw class. I have tried to import that class manually..
  • ```java
  • import stdlib.StdDraw;
  • ```
  • But `stdlib` doesn't exist. That's what I am getting as error.
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • ![No Project Structure](https://imgur.com/dSj7GGr.png)
  • What!! I can't see any project structure option in netbeans. Ohh They had wrote the answer for IntelliJ. But I am using Netbeans. Even I don't have any file called `/lib`. I know that I have to put a line in gradle.build
  • ```gradle
  • implementation 'file_name'
  • ```
  • But I don't have any idea where I should put that jar file. I have created a folder called libs and pasted that jar file there. Then added the line to gradle.build
  • ```gradle
  • implementation fileTree(dir: 'libs', include: ['*.jar'])
  • ```
  • I have re-sync my project. Although I can't find that StdDraw class. I have tried to import that class manually..
  • ```java
  • import stdlib.StdDraw;
  • ```
  • But `stdlib` doesn't exist. That's what I am getting as error. ~ I was following [the answer](https://stackoverflow.com/a/48930705/16897106)
#5: Post edited by user avatar Anonymous‭ · 2021-10-01T04:42:21Z (over 2 years ago)
  • How to install a package in Netbeans?
  • Why I am unable to find a class after implementing library also?
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • ![No Project Structure](https://imgur.com/dSj7GGr.png)
  • What!! I can't see any project structure option in netbeans. Ohh They had wrote the answer for IntelliJ. But I am using Netbeans. Even I don't have any file called `/lib`. I know that I have to put a line in gradle.build
  • ```gradle
  • implementation 'file_name'
  • ```
  • But I don't have any idea where I should put that jar file.
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • ![No Project Structure](https://imgur.com/dSj7GGr.png)
  • What!! I can't see any project structure option in netbeans. Ohh They had wrote the answer for IntelliJ. But I am using Netbeans. Even I don't have any file called `/lib`. I know that I have to put a line in gradle.build
  • ```gradle
  • implementation 'file_name'
  • ```
  • But I don't have any idea where I should put that jar file. I have created a folder called libs and pasted that jar file there. Then added the line to gradle.build
  • ```gradle
  • implementation fileTree(dir: 'libs', include: ['*.jar'])
  • ```
  • I have re-sync my project. Although I can't find that StdDraw class. I have tried to import that class manually..
  • ```java
  • import stdlib.StdDraw;
  • ```
  • But `stdlib` doesn't exist. That's what I am getting as error.
#4: Post edited by user avatar Anonymous‭ · 2021-10-01T04:37:32Z (over 2 years ago)
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • ![No Project Structure](https://imgur.com/dSj7GGr.png)
  • What!! I can't see any project structure option in netbeans. Ohh They had wrote the answer for IntelliJ. But I am using Netbeans. Even I don't have any file called `/lib`.
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • ![No Project Structure](https://imgur.com/dSj7GGr.png)
  • What!! I can't see any project structure option in netbeans. Ohh They had wrote the answer for IntelliJ. But I am using Netbeans. Even I don't have any file called `/lib`. I know that I have to put a line in gradle.build
  • ```gradle
  • implementation 'file_name'
  • ```
  • But I don't have any idea where I should put that jar file.
#3: Post edited by user avatar Anonymous‭ · 2021-10-01T04:34:47Z (over 2 years ago)
  • How to install a package?
  • How to install a package in Netbeans?
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • ![No Project Structure](https://imgur.com/dSj7GGr.png)
  • What!! I can't see any project structure option in netbeans. I am running Gradle Project. I am more familiar with Gradle rather than Maven.
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • ![No Project Structure](https://imgur.com/dSj7GGr.png)
  • What!! I can't see any project structure option in netbeans. Ohh They had wrote the answer for IntelliJ. But I am using Netbeans. Even I don't have any file called `/lib`.
#2: Post edited by user avatar Anonymous‭ · 2021-10-01T04:33:16Z (over 2 years ago)
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • I had found a better way to plot in Java.
  • ```java
  • int n = Integer.parseInt(args[0]);
  • // the function y = sin(4x) + sin(20x), sampled at n+1 points
  • // between x = 0 and x = pi
  • double[] x = new double[n+1];
  • double[] y = new double[n+1];
  • for (int i = 0; i <= n; i++) {
  • x[i] = Math.PI * i / n;
  • y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
  • }
  • // rescale the coordinate system
  • StdDraw.setXscale(0, Math.PI);
  • StdDraw.setYscale(-2.1, +2.1);
  • // plot the approximation to the function
  • for (int i = 0; i < n; i++) {
  • StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
  • }
  • ```
  • I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use
  • ```java
  • import StdDraw;
  • //or
  • import stddraw.StdDraw;
  • //or
  • import StdDraw.*;
  • ```
  • None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.
  • ![No Project Structure](https://imgur.com/dSj7GGr.png)
  • What!! I can't see any project structure option in netbeans. I am running Gradle Project. I am more familiar with Gradle rather than Maven.
#1: Initial revision by user avatar Anonymous‭ · 2021-10-01T03:23:21Z (over 2 years ago)
How to install a package?
I had found a better way to plot in Java.

```java
        int n = Integer.parseInt(args[0]);

        // the function y = sin(4x) + sin(20x), sampled at n+1 points
        // between x = 0 and x = pi
        double[] x = new double[n+1];
        double[] y = new double[n+1];
        for (int i = 0; i <= n; i++) {
            x[i] = Math.PI * i / n;
            y[i] = Math.sin(4*x[i]) + Math.sin(20*x[i]);
        }

        // rescale the coordinate system
        StdDraw.setXscale(0, Math.PI);
        StdDraw.setYscale(-2.1, +2.1);

        // plot the approximation to the function
        for (int i = 0; i < n; i++) {
            StdDraw.line(x[i], y[i], x[i+1], y[i+1]);
        }
```

I don't have the StdDraw class. I was searching in internet what should I do to import the class. I had seen that they said to use

```java
import StdDraw;
//or
import stddraw.StdDraw;
//or
import StdDraw.*;
```

None of them are helpful cause I don't have the StdDraw package. I had found [it](https://introcs.cs.princeton.edu/java/stdlib/) then. I can see StdDraw there. But I don't have any idea how can I convert that .java.html to .jar. I had found [it](https://stackoverflow.com/a/32853178) to import the package. But the problem is I can't download the package at first.