1,092 questions
0
votes
0
answers
56
views
I show this error message when I run java 3d :Can't load AMD 64-bit .dll on a IA 32-bit platform
When I downloaded the java 3d api library from the oracle site version 1.5.1 and placed it correctly in the files of the bluej program version 4.1.2, this error message appears to me when running the ...
0
votes
0
answers
86
views
How to update BlueJ Java jdk and JavaFX versions
I recently got the warning, when starting a project using Bluej (under Windows 10):
javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 23.0.1 ...
0
votes
1
answer
94
views
Why is my output different after each execution of the program?
So I am new to java and was trying to learn about simple data structure and wrote a program in bluej to pop in a stack. However after compiling and executing the program the output is different each ...
0
votes
2
answers
63
views
My program keeps stuttering after the 2nd loop, at grades. It would leave a blank line for a value. Is there any way to solve this?
My program keeps stuttering after the 2nd loop, at the grades user input. It would leave a blank line for a value, accepts the value, and would continue doing that for the rest of the loop, never the ...
0
votes
0
answers
63
views
Bluej throws SSLHandshakeException making http request
Simple http request application works outside Bluej but in Bluej throws exception.
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
...
1
vote
1
answer
417
views
How do you change the default startup code on BlueJ?
Every time I start BLueJ up, create a new project, and create a class in the project, and open the editor, it defaults to some pre-written code, and I was wondering if I could change that so every ...
0
votes
2
answers
92
views
How to check decimal values with if-else construct accurately?
I was doing a simple program for calculating the area of a scalene triangle. We basically have to first calculate the area and then input 5 answers and check how many are correct. However, whenever I ...
0
votes
1
answer
323
views
JUnit test failing using assertEquals on a method that returns a StringBuilder
In testing a Fleet Management application, multiple tests are failing in regards to making sure that a specific report of vehicles, which returns a StringBuilder, contains the actual data given to it. ...
0
votes
2
answers
97
views
File not found when trying to pass user given file to new scanner object
public void readItemData()
{
try {
Frame frame = null;
FileDialog fileBox = new FileDialog(frame ,"Open", FileDialog.LOAD);
fileBox.setVisible(...
0
votes
1
answer
252
views
How to create a unit test for a method searching keywords within a list of objects?
I have a Library application and am trying to create tests for the methods in it. The books in the list being searched consist of a title, author, and ISBN number. The tests for the ISBN search method ...
3
votes
3
answers
178
views
Creating an even and odd array of specific parameters from an original array
Write a program to accept 15 random numbers into a 1D array. Sort the array using Bubble Sort. After sorting, transfer and store all the even numbers and odd numbers into separate arrays. Display the ...
0
votes
1
answer
122
views
How can I fix this strange text in Blue J
I downloaded the program from the official website, had a normal installation, and literally without move anything, I got this strange language text, I tried to change language in preferences trying ...
0
votes
0
answers
3k
views
I'm getting this error: WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @c6018c6'. What should I do?
Before I updated BlueJ this program worked fine, but now that I have updated to version 5.1.0 the program doesn't work and shows the above error message. If you need more info on the error message I ...
1
vote
1
answer
459
views
Java 8 JDK is installed but installing BlueJ fails
I'm using linux OS with Debian 11 distribution. I'm using this this documentation.
The output of javac -version is javac 1.8.0_371 indicating that I have Java 8 JDK installed.
I downloaded the ...
-1
votes
1
answer
256
views
i was getting the error: undeclared variable: IO in the following java program, but the code is right according to my knowledge
public class CourseGrade {
public static void main(String[] args) {
int examWeight = 70;
int labWeight = 20;
int hwWeight = 10;
double examScore;
double ...
0
votes
1
answer
549
views
Line break in BlueJ not working (\n \r\n)
I am trying to add a line break in blueJ but it won't work since the return type of String will return the literal character. I have tried both \r\n and \n same result.
public String testNl() {
...
2
votes
0
answers
158
views
Creating a non-Attacking Queens game that is supposed to print out all 92 solutions of 8 queens on a chess board that cannot attack eachother
I made the 8x8 chess board and have a lot of the code done, but for some reason it only print out one solution, does anyone know why this may be and how I can fix it?
public class NonAttackingQueens {
...
0
votes
0
answers
177
views
How to configure Intellij Idea to compile files induvidually without building the whole folder?
I am new to IntelliJ, I started using it because it streamlines java coding stuff.
I am currently a student so my main java folder is not a complete project but a collection of different individual ...
1
vote
0
answers
53
views
Delete a certain sentence from terminal window
I would like to delete the sentence "RobotID.....on" from appearing every time I use the scanner for Karel Robot. Is there a way to do it?
I tried using system.out.flush(); to see if it ...
-1
votes
2
answers
131
views
How to find the product of the first 16 multiples of 2 starting with 2?
I need to find the first 16 multiples of 2 starting with 2. Then find the product in the next line like this. I need to use for loops only.
Sample output: 2 4 6 8 10 12 ...
The product is ______
I ...
0
votes
0
answers
25
views
Java Graphic problem with getting correct generation on my graphic lines
I am trying to finish a project that I have been working on for fun on Java, and I'm genuinely trying to figure this out. Here is the code. I put a comment where the problem starts.
// Lab04vst.java
//...
0
votes
0
answers
135
views
Matrix multiplication in BlueJ (Java)
can anyone find me the mistake in the following code?
This is the multiplication of matrices that contain fractions. It shows me a NullPointerException and underscores the line with z[i][j].
The ...
0
votes
1
answer
108
views
How to test for a returned Object in Unit testing in Java, BlueJ?
So let's assume I have a class in Java called ItemClass and I'm calling one of the methods in the class which returns an object of type Feedback where Feedback is another class.
Now, how can I test if ...
-2
votes
1
answer
72
views
How do I add a method so I can just a String instead of typing a whole statement
how do i make it so i only have to type "onion" instead of typing the whole thing.
I am trying add a String for the Flavour of PackOfCrisps, but i have to type:
new PackOfCrisps("onion&...
0
votes
0
answers
62
views
BlueJ: invalid cen header
I wanted to install BlueJ on my home PC and create a class. When I created it and pressed "compile" it just gives the error: cannot access unnamed package: invalid CEN header (unsupported ...
0
votes
1
answer
364
views
Defining charAt variable to use in a loop with a boolean statement for letter matching
I am trying to create a boolean expression to tell me if a letter given is in a word using charAt. An example is if the secret word is daisy and I give the letter i, it returns true but if I give m, ...
-1
votes
1
answer
454
views
Messing around with graphics in Java
I want to make an animation of an ellipse growing and shrinking in length. The animation should be continuous, so I want the length of the ellipse to grow to a certain point and then shrink back to ...
0
votes
0
answers
94
views
Bluej asks for reference when I try to add Graphics
This might be a very dumb question but I tried to solve this for hours and am really tired, so I just found out about about Graphics and I wanted to draw a rectangle in bluej but in every tutorial it ...
-2
votes
1
answer
817
views
Writing a program to find smallest and largest number in a random array. Logic of the program is correct, but not executing properly. What's the fix?
Here is the program:
import java.util.Scanner;
class NumbersInArray
{
public static void main()
{
System.out.println("\f");
Scanner sc = new Scanner(System.in);
...
0
votes
0
answers
455
views
Menu Driven Program where user inputs string and selects either of 2 patterns to print not compiling. java.lang.ClassNotFoundException error coming
This is a menu driven program. The user inputs a string and can select either of 2 patterns to be printed using the given string. These are the 2 patterns:
Both patterns
This is the code for my ...
0
votes
1
answer
35
views
Program to find if a string is a palindrome keeps on failing. Even after using toLowerCase() command for both strings, output doesn't come
import java.util.Scanner;
class Palindrome_string
{
public static void main()
{
System.out.println("\f");
Scanner sc = new Scanner(System.in);
System.out....
-4
votes
1
answer
431
views
Keeping a running average of values in java [closed]
I am trying to calculate the average of values given via repeated function calls.
Actually Bluej allows me to put the number to rate but if i am trying to put again it replaces the previous one, i ...
0
votes
0
answers
64
views
Circle continuously duplicating and glitching in scene
I'm trying to make a 2D version of Universe Sandbox. I was just starting on coding the gravitational effect on the planets; but once I tested the code, a couple glitches started happening. One of the ...
0
votes
1
answer
581
views
Why can't I push changes from BlueJ to GitHub?
I have stumbled upon the problem that when I try to push something to my repository through BlueJ (I have connected the BlueJ file with the repository by entering my GitHub credentials), the following ...
0
votes
1
answer
4k
views
How to implement dark mode in BlueJ using Github link
I am new to programming and have been using the IDE BlueJ. I wanted to change to dark mode using the code given in this GitHub link:
https://github.com/t-ye/bluej-dark-theme
The instructions there say ...
2
votes
1
answer
2k
views
How do you quickly compile and run in BlueJ?
I've used IntelliJ and VSC before, both of which had nice one-button solutions to compile and run, even going as far as having keyboard shortcuts for it as well. But unfortunately, for reasons I'm not ...
-2
votes
1
answer
110
views
How do I check an array's bounds and make sure the code does not error in the game "Go" that I am making in Java
protected void pressedOnSpace(int row, int col) {
if (board[row][col] < board[0][0]) {
canvas.errors = false;
}
if (board[row][col] == GoFrame.WHITE) {
board[row][col] ...
0
votes
1
answer
832
views
Java chess game: how to check whether a piece is already on the tile?
I´m currently programming my first chess game and I have a small problem with my pieces. I´ll add some of my code below, but generally, I would like to check whether the tile a player moves a certain ...
1
vote
1
answer
384
views
How can this java code display an output in BlueJ?
The code below is for a graphical user interface that has a loginframe that will enable the user to input their credentials. However, when I run the code it does not show an output. Can anyone help?
...
1
vote
1
answer
2k
views
How to make my jar file executable by double click to open terminal
Okay so basically, every time I've seen this question asked it doesn't have the answer I'm looking for which is why I'm trying to ask myself.
Basically, I made a java project on BlueJ (required by ...
0
votes
0
answers
142
views
Get list of sqlite databases using Java (BlueJ)
So I'm currently learning SQLite using Java (BlueJ) and this is my first time using SQLite, and I'm curious how to see the existing databases on my projects folder, let's say I have 3 databases in my ...
0
votes
1
answer
89
views
java variables not being initialized
I have the following code which outputs 0 and 5 when run the first time. However, if I rerun the program I get 5 and 5 from BlueJ (ide) and 0 and 5 from coding roooms (ide). Is this a bug in BlueJ?
...
0
votes
1
answer
644
views
How do I correctly use a removeBook(Book) method which takes a Book as an argument
I am asked to create a method called removeBook(Book) which takes a Book as an argument. I have two classes Library and Book, I am using an ArrayList<Book> and an Iterator<Book> in my ...
2
votes
1
answer
200
views
How do you prevent a group from moving by itself when moving objects inside of it?
It seems that when I move the circle outside the group of squares, it moves the squares even though there is no code that does that. I'm 99% percent sure it is because the group is trying to auto ...
0
votes
1
answer
320
views
How do you detect when the cursor hovers over an object while the mouse is being pressed before the cursor enters the object?
The situation I'm currently in is, I have a circle on a screen and if I hold LMB down first and then drag my cursor across it, nothing happens. I've tried looking through different EventHandlers I ...
0
votes
0
answers
119
views
How to use an arraylist from another class?
This is the class where I made my arraylist in and I am trying to use this arraylist over in another class but it keeps on giving me the error of not finding the metho
public HumanResource(String ...
0
votes
1
answer
606
views
JavaFX Application: Why does a single left-click on MenuButton cause ContextMenu to flicker on-off?
I do not understand why when I left-click the MenuButton that the ContextMenu does not simply appear and stay, or disappear when I click a second time like a visibility toggle. A short code example ...
0
votes
1
answer
62
views
I am trying to create a number of Employee objects same as the number of line it reads from the file [closed]
list of lines
private ArrayList lines;
list of Employee objects
private ArrayList<Employee> employeeList;
the file information of employee
private FileReader file;
public HumanResource(String ...
0
votes
1
answer
506
views
How to solve NoClassDefFoundError?
I am enrolled in the Duke University course offered by coursera "Java-Programming-Arrays-Lists-and-Structured-data".
I am using Eclipse instead of using BlueJ for my own ease. But when I try ...
-4
votes
3
answers
216
views
How can I create all lowercase except for the last word?
What I have so far is enter image description here
so if i were to input "Happy Holidays To YOU and YOUR Family"
i want my output to be "happy holidays to you and your Family"