32,204 Topics
| |
I have a custom class which extends JPanel and overrides the paintComponent() method. Here's what that looks like: @Override protected void paintComponent(Graphics g) { if(redrawRequested) { g.setColor(ETCH_BACKGROUND_COLOR); g.fillRect(0, 0, owner.getAppWidth(), owner.getAppHeight()); redrawRequested = false; } g.setColor(Color.BLACK); g.fillRect(pointX, pointY, PIXEL_SIZE, PIXEL_SIZE); } The same custom class also implements KeyListener. I am … | |
hi I am trying to build this multiplication game program, well it is the same multiplication game as before. It seems to be working fine but it is not giving me the exact output. first: - when the user enter the correct answer the first time, the game stop when … | |
There are two methods in different classes public EmployeeBean viewEmployeeByID(String EmployeeID) public EmployeeBean findByID(String id) Given, the description of each method of what it supposed to do public EmployeeBean findByID(String id) This method should use the JDBC select statements to retrieve the record based on the given Employee ID, Store … | |
HI. I have been working on a 4 class program. I have some errors and would like to know what I am doing wrong. If you can help out, It would be great. Thank you! Here is a github of all my work. https://gist.github.com/anonymous/b629b37d40e017881108 | |
I'm muwanguzi lynda doing java but the way of writing a java program is aproblem,Can any one help to write 4 me a code that displays the students name,Reg.no.,course units,the marks & Grades in java. | |
I tried to make a program that would give the whole factors for an inputed number. When i run it throught the command prompt it gives me a bunch of 1's, how do I make it to print each factor only once? import java.util.Scanner; public class Factors { public static … | |
I am trying to write a program where the user can enter a height and width and it creates a hollow box of asterisks. I can get the stars to print out but what is wrong with my code that it is putting them in weird lines. How do I … | |
how can i synchronize any method or constructor in java by using socket | |
Hello guys! I need advice. So I'm working on a Reservation feature of a system. I have created a DAO's for Customer, Employee, and CustomerInquiries. I will explain to you how this works first. The customer creates a "customer inquiry" on the company website to inquire about rental of buses. … | |
hello i m writing a program in which i try to write on the frame by mousemotionlistener and mouselistener methods till now i did the writing part and i i want to start that writing by clicking the button Ok then another frame is open in which i can write … | |
I just started learning Java. I need to make a chat messenger project in java for my college project. The messenger should be able to send messages,add persons to chat and to see who is online. I have only one month of time for my project. Please tell me how … | |
I have a program nearly complete - it creates a bank object which creates within it customers and accounts of multiple types and can successfully load this information to display on the screen. The problem is that I am now trying to deposit or withdraw a given balance which has … | |
I am writting a code to show the number of ways we can pick k # of objects from n total # of objects, and order them without repetition(n choose k). I am given the recrusive for public static long tough(int x, int y) { if (x < y) return … | |
Hi I am using razorflow chart software to create a dashboard, this works perfectly on my dev server(Locally) but when I upload it to hosted server(Web) it does not load properly. https://www.razorflow.com/ I get the following errors: value is not a number Uncaught TypeError: Cannot read property 'split' of undefined … | |
Hello, I am getting this error org.apache.jasper.JasperException: The absolute uri: <requiredURI> cannot be resolved in either web.xml or the jar files deployed with this application. Although the required jar is present in the classpath I am still facing this issue. But if I insert the same jar into web-inf/lib folder … | |
First off, here is the code I will be referencing: package com.airamerica.dataConversion; import com.airamerica.Airports; import com.airamerica.Person; import com.airamerica.Products.Products; import com.airamerica.Products.Tickets; public class FindObject { public static Airports findAirport(String airportCode, Airports [] airportsArray){ Airports airport = null; for(int j = 0; j < airportsArray.length; j++) { if (airportCode.equals(airportsArray[j].getCode())){ airport = airportsArray[j]; … | |
Everytime I run this nested code, I just get stuck inside of an infinite loop.. any help? I'm not familiar with nested loops at all. I'm supposed to be getting: 123456 12345 1234 123 12 1 public void displayPatternII (int lines) { System.out.println("\n\tPattern II\n"); for (int i = 6; i … | |
Hi guys why am I getting the error identifier expected at the package statement ? Here is my code. package com.example.abstract; public abstract class Car{ private double price; private String color; private String year; private String model; abstract double accelerate(); abstract double horsePower(); public void setPrice(double price){ this.price = price; … | |
Hi guys , Assume the following is my program, is there a way to see how the memory is being allocated by the java program ? How do I use jconsole to find out where in main memory that Integer i = 10 is being saved? public class IntegerCmp{ public … | |
It took me 4 weeks to write this code. The chess game works now . there are no bugs... everything confirms to the chess rules (part from stalemate that i was too lazy to do). i have been learning java for 4 months. what do you think of my code … | |
Hello guys. I'm trying to create a registration form that takes in employee information. The error I'm getting is: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 I'm … | |
I'm a tad confused on a homework assignment. I'm supposed to write a program that displays a table of the Celsius temperatures 0 through 20 and their Fahrenheit equivalents. I got the loop to work just fine, but I'm supposed to display the results of the loop in a TextArea … | |
Hey guys I'm looking for some insight in what would be the best way to stop and start a java program remotely with my cell. "For free". Lemme know ANY ideas!!!! Thanks Scheppy | |
Hi i have a bit of code: On the 1st day of Christmas, my true love sent to me A partridge in a pear tree. On the 2nd day of Christmas, my true love sent to me Two turtle doves, And a partridge in a pear tree. On the 3rd … | |
Actually when the main function is running in a class, it implictly speaks a Main thread is in running in background. public static void main(String[] args){ ...... } Now when we create a thread objects in the above function like this . For example : public class NewThread extends Thread … | |
So, I have heard about code porting, basically where you take existing code from one language, and translate it to another language. What I want to know is how does this process work? Are there automated tools for preforming this type of thing, or is it always a manual process? … | |
I have three files 1. Bank Instance 2. Bank 3. Main // Bank Instance.java public class BankInstance implements Runnable { public Bank bank; public Thread t; public BankInstance(Bank bank,String nameOfCustomer){ this.bank = bank; t = new Thread(this,nameOfCustomer); t.start(); } public void run() { System.out.println("========================================================"); System.out.println("Initial amount in bank"+bank.displayAmount()); System.out.println("Amount after … | |
So I have 2 files: M.java, and construct.java. In construct .java, I have 5 instance variables, and made a constructor to initialize the variables. I have also created an getters, adn setters for each instance variable. In Main. java, I created an array: construct[] c= {new construct(int1, string1, string2, string3, … |
The End.