32,199 Topics
| |
package Assignments1; public class project { public static void main(String[]args) { While (we have money left to spend and (itemNumber <=max number of items)) { Display amount of money left and number of items that can be bought. Read cost of proposed purchase if(we can afford the purchase) { Display … | |
Hi, I'm a computer science student, my O.S teacher asked us to write a operating system simulator in java, each group of students should write a piece of the simulator, like memory management, process scheduler, file system, etc. My group needs to make the file system part, it's more like … | |
so i have two animation. one is when player is standing and one is when player get hit. 'standing' animation will keep looping for ever. and 'planehit' animation should loop though onces and stop. in player class iam setting up animation by getting images. 'standing' animation has two images. 'planehit' … | |
Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program that randomly fills in 0s and 1s into an n-by-n matrix,prints the matrix,and finds the rows and columns with the most 1s.(HINT:Use two ArrayLists to store the row and column indices with the … | |
I'm trying to make a dictionary program using linked lists. I need four classes, one that holds the word and the meaning. One that creates the node of information and its link field. Another class that creates and maintains a linked list of words and their meanings. And then a … | |
Hi This code not run : it show this error: incompatible types-found java.lang.String but expected HuffmanCodingAnimation.Node This line of code ` root.left.code = root.code + "0";` Here is the code: import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.tree.*; /* * This program enables a user to enter text and displays … | |
Hello guys. I have yet another problem. I have a simple app that has "endless" scroll(simple example would be 9gag, except 9gag is a web page), the point is when user scrolls to bottom new items/articles are loaded. I have managed to do the endless scrolling, the problem is when … | |
My top-level package is "com.gmail.email.aviersproject". In .aviersproject have a class that holds my main method and a package "summonerdata". In that package I want a class that gets summoner data by screen scraping. My question is what a good name would be? I was thinking SummonerDataScreenScraper or SummonerDataScraper but it … | |
Ok so I have 2 String variables holding dates in the format dd/mm/yyyy and I need to find the difference in days between them. Ideas? Eg. String date1 = "dd/mm/yyyy"; String date2 = "dd/mm/yyyy"; int difference = (date1 - date2); EDIT: and unless *absolutely* necessary, I dont want to use … | |
Hello everyone. I'm trying to do simple app that has a listview, listview is populated with info from json file. 20 items downloaded at a time. And when user is scrolling to the bottom next 20 items are loaded. Problem is when my app loads next 20 items the scrollbar … | |
Okay, i am creating a code library for myself and i am wondering how does one display java code on an html page? I asked my teacher how to do it and he said he has never done it before and the students told me that is an interesting question. … | |
Hey everyone, Im having trouble with the placement of GUI components and need you help getting the things in the right place. The problem is on the left side where the elements are all misplaced including: The JMenuBar - should be up against the left wall JLabel "content for..." - … | |
I am making a battleship game with 2 boards, each is on a JFrame, but I do not know how to get them to close when a button is pressed in order to show the new one. package battleship; import java.awt.Color; import java.awt.GridLayout; import java.awt.Toolkit; import java.awt.event.WindowEvent; import javax.swing.JButton; import … | |
I thought it would be really cool if JOptionPane could be extended to accept an array of strings that represent messages, and have the method return an array of strings that represent user answers to the messages which are entered into the dialog box. This would make getting GUI input … | |
Hi I am building a website to have interactive feature, and I was thinking of the implementing a live feed for a log file where it would take the content of the log file and do something with it, like create pop ups or images, it sounds possible in my … | |
Task 1 This assignment will consist of writing a couple of small programs that involve practice writing Filename: Seconds.java In a class called Seconds: 1. Write a method called toSeconds that takes in three integer parameters (representing hours, minutes, and seconds) and returns the number of seconds since the last … | |
i need a latest model java run software. where do i find this? | |
Is there any way I can place a video in a JFrame/JPanel? Can someone point me to a tutorial, I can't find anything useful through Google. | |
Hi Everyone, I am trying to get the program below to work correctly. The line below is where I'm having trouble. (line 33 in PrefixCalc.java) calc = new ExpressionTree(new Scanner(console.nextLine())); When I run the program and enter "4 + 8", the scanner only picks up "4". Apparently this program was … | |
This is my code : import java.awt.Button; import java.awt.Component; import java.awt.Container; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.*; import javax.swing.AbstractButton; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.SpringLayout; public class SpringSample extends Frame implements ActionListener { private static final long serialVersionUID = 1L; SpringSample() { … | |
Hey guys! I am working on a school project where I choose "The Evolution of Technology" as my topic. It'll be from making stone tools and fire to the modern information age. I choose a videogame to represent my research and outcome and I'll use Java. I already knew a … | |
Hello Im trying to send emails thru Java and they have HTML plus embedded images. Everything shows up except the embedded images. What could be wrong? My email is a entire String with HTML code. Thank you | |
i have a class enemyboss and sending it to different class called levelObject. main.java EnemyBoss enemyObject; ... //game loop - actionperformed levelObject.nextLevel(enemyObject); ... //paint method if(enemyObject!=null){ enemyObject.paint(g); } in level.java class i am createding enemyobject class. level.java ... enemyObject = new EnemyBoss(50, 20); ... the problem is nothing prints on … | |
Hey guys, I was wondering if you could tell me if this is even possible or if it can be done another way??? So i have a database with 6 tables all the databases have the same columns except for the tables name ahead of the generic headers pub_name, Hotel_name, … | |
Hi apostrophes not displaying in SOAPUI,Am using Java ws to display output in SOAPUI, am facing the problem in displaying apostrophes('), its displaying '&'. any suggestion please. | |
I need to revise a previously written code with a class I just wrote. My Program: import java.util.Scanner; import java.util.Arrays; public class ModifiedLab7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("How many points? "); int n = input.nextInt(); double[][] points = new double[n][2]; for(int i … | |
Ok I am making a user interface for Battleship and want a Frame to appear on the side with the title and instructions of the game in a disabled JTextArea. With the code I have now I can get the JFrame to open blank. The JTextArea only appears if I … | |
Allright. It's me again. :D This time, I'm making an alarm clock program. I've already completed the bit that gets and displays the system time: Date vrijeme = new Date(); int sati = vrijeme.getHours(); int minuti = vrijeme.getMinutes(); int sekunde = vrijeme.getSeconds(); Also made a method that compares that time … | |
I need help creating my moneydriver. requirements: 1- the driver class should create an array of 5 objects. 2- must use loop to determine which Money object has the most amount of money. 3- I need to use compareMoney() method for my comparison. I start building my MoneyDriver but need … |
The End.