32,199 Topics

Member Avatar for
Member Avatar for markchua89

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 …

Member Avatar for markchua89
0
182
Member Avatar for modesto916

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 …

Member Avatar for gusano79
0
158
Member Avatar for game06

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' …

Member Avatar for game06
0
208
Member Avatar for SHINICHI

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 …

Member Avatar for JamesCherrill
0
755
Member Avatar for Akusa

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 …

Member Avatar for JamesCherrill
0
206
Member Avatar for Dorar

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 …

Member Avatar for JamesCherrill
1
649
Member Avatar for Nomorewine

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 …

0
144
Member Avatar for sha11e

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 …

Member Avatar for JamesCherrill
0
170
Member Avatar for RockJake28

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 …

Member Avatar for bguild
0
228
Member Avatar for Nomorewine

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 …

Member Avatar for Nomorewine
0
137
Member Avatar for <M/>

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. …

Member Avatar for <M/>
0
2K
Member Avatar for shobhit.yadav.31
Member Avatar for milkman93

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..." - …

Member Avatar for milkman93
0
193
Member Avatar for Nandomo

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 …

Member Avatar for Nandomo
0
266
Member Avatar for overwraith

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 …

Member Avatar for overwraith
0
2K
Member Avatar for scarletfire

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 …

Member Avatar for fheppell
0
131
Member Avatar for sharmeen.batool

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 …

Member Avatar for JamesCherrill
0
133
Member Avatar for rajhoq12
Member Avatar for JamesCherrill
0
72
Member Avatar for Nandomo

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.

Member Avatar for Ezzaral
0
191
Member Avatar for coolbeanbob

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 …

Member Avatar for deceptikon
0
335
Member Avatar for chdboy

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() { …

Member Avatar for chdboy
0
2K
Member Avatar for funkey100

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 …

Member Avatar for funkey100
0
293
Member Avatar for riahc3

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

Member Avatar for riahc3
0
1K
Member Avatar for game06

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 …

Member Avatar for JamesCherrill
0
131
Member Avatar for joseph.lyons.754

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, …

Member Avatar for Webville312
0
210
Member Avatar for softswing

Hi apostrophes not displaying in SOAPUI,Am using Java ws to display output in SOAPUI, am facing the problem in displaying apostrophes('), its displaying '&amp;'. any suggestion please.

Member Avatar for stultuske
0
93
Member Avatar for thewayoftheduck

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 …

Member Avatar for stultuske
0
264
Member Avatar for Nandomo

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 …

Member Avatar for bguild
0
159
Member Avatar for Pobunjenik

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 …

Member Avatar for Pobunjenik
0
933
Member Avatar for toldav

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 …

Member Avatar for somjit{}
0
261

The End.