35,618 Topics
![]() | |
Hello, World! My name is Alex and i am a beginner in Java. I tried to create 2 simple objects from the same class and give them the values inputed from console( as string). Is this correct or it should be done in another particular manner? Also, the constructor asks … | |
![]() | I am trying to build XML to csv conversion The problem is extended attributes ( <AttrList> ) that I do not know how to read: This is the XML: <?xml version="1.0" encoding="UTF-8"?> <ProductCatalog> <Product> <ProductCode>FFC4UINTSATA</ProductCode> <Vendor>INTEL</Vendor> <ProductType>Cable</ProductType> <ProductCategory>Cables</ProductCategory> <ProductDescription>INTEL SAS/SATA internal cable (4xSerial ATA 7-pin (Male) - 1x (Male))</ProductDescription> <Image>https://www.it4profit.com/catalogimg/wic/1/FFC4UINTSATA</Image> … ![]() |
Hi, I have one class where JFrame is created and 4 classes (JPanels - Menu, Game, Score, etc.). In the class, where I am creating Frame I also create new Menu (JPanel) .. in menu, I have 4 buttons. If I click e.g. on a button Start ... the new … | |
I am trying to create Menu to may 2D game in Java. But the game is not responding to pressed keyes. Menu is working, but when I choose new game in menu, game starts but it does not react to pressed keyes. But, when I remove menu, game is responding … | |
I am using javaCC to parse through sql statements and put the data in corresponding lists. I have made the grammar for a create table that works well but now I need help on making a insert statement grammar. This is the create table grammar that I have used but … | |
I am trying to style a log in menu that is created by this snippet i have here (generated by javascript): <script> var password; var correctpassword = "DaNiWeB"; password = prompt ('Enter the Correct Password to view this page:',''); if (password==correctpassword) alert('Thank you for properly entering the password, you may … | |
I was wondering if anyone had a good implementation of a List of list. The reason is to create rows and columns sort of like a database or spreadsheet format. I would like to insert data into the list and print it in the format of Column Column Column Column … | |
I am creating a method to multiply 2 polynomial expressions together such that: `3x^5 * 2x^3 = 6x^8` -> Where the coefficients are multiplied and the exponents are added together. My test case for this would look something like the following @Test public void times01() throws TError { assertEquals(Term.Zero, Term.Zero.times(Term.Zero)); … | |
Hey can you guys help with this? Basically with all that is left? Thank you! import javax.swing.*; //for JFrame import java.awt.*; //for Graphics and Container import java.util.Random; import javax.swing.JOptionPane; // other import statements here public class RandomGraphics { // constants are used to draw the grid, and for you to … | |
My applet creates a new sound every time an impact occurs, which is very frequently. How come, when the sounds become too numerous, the game ceases to run smoothly? Here is the code that gets called many, many times: class soundThread extends Thread { String sound; soundThread(String i_sound) { sound … | |
I have to mirror a piece of the picture right to left. Here is what I have: My picture stays the same everytime I run the code. I even switch my for loops to see if it would make a difference but it doesn't. My picture just stays the same. … | |
Hi, This code doesn't seem to compile. I can't seem to figure out what's wrong with it. The error I get is: **cannot find symbol - method contains (java.lang.string)** public void getName (String name) { for (olympian filename: Olympians) { if (filename.contains(name)) { System.out.println(filename); } else { System.out.println("Nothing found"); } … | |
Still playing with multi-threading and Prod-Con, at this point I've been at this for days. Would love some help debugging; thanks in advance. http://pastebin.com/jhHB9kTY - Main http://pastebin.com/BZSspf3x - Consumer http://pastebin.com/ndzAADJz - Producer http://pastebin.com/p7YdzH1D - Product http://pastebin.com/rxs3WzDT - Message http://pastebin.com/JR5ywgz1 - Utiliy 2 Producers, 4 Consumers Essentially Producers push a message … | |
I am writing code in java to support a working database. What I mean by that is I will have linked list store the data(I plan to change later) and use a parser to break down sql statements in turn interacting with the linked list. The question I have is … | |
Hi, Why does this piece of code throw me an error saying: **cannot return a value from method whose result type is void**? public void orderTotal() { int total; for (Order filename: Orders) { total = filename.getQuantity(); } return total; } | |
Hi folks. I am in search of automated swing builders (stylish jframe builders). Basically like IDE's. Yeah I am well familiar and bored of this netbeans, eclispse, etc. Can anyone suggest me some tools that will create some cool and **stylish** jframes or swings by just drag and drop.. I … | |
i need help to write a code for the folllowing question. A realtor wishes to track her commissions of house sales. The information that she collects is as follows: house address a string house type a string ( split level, bungalow, etc.) sale price a double She wishes to calculate … | |
hi every one =) I just started to learn trees in java but I am kind a lost with it is implementation I need to understand implementing and tracing methods useing tree interfaces please post any recommended source , tutorial or lecture thank you | |
Hi, I was creating clone of breakout and got the game working correctly. But after setting up menu my keyboard doesnt respond anymore. But if I launch game directly without Menu class keys are working perfectly. Where the problem might be? Here is the full source code. VBreakOut.java package net.viped; … | |
The code below compares three numbers and it prints out the Maximum and Minimum value, let me hope it will rescue somebody :) import java.util.Scanner; public class MaxMin { public static void main(String args[]) { int w,x, y; System.out.println("\n\nTHE PROGRAM BELOW CALCULATES AND OUT PUTS THE MAXIMUM AND MINIMUM OF … | |
Hello, I'm in a pickle. (Please observe the code) In the actionPerformed method, I don't know how I can get the value of the variable 'minutes'. I can get 'hours' by e.getActionCommand(), but can't do minutes that way. I need to get both 'hours' and 'minutes' at the same action. … | |
Consider the following: for (int counter = 1; counter < 1; counter -) How many times will the loop execute? | |
I have a Java class called Term holding polynomials like below public Term(int c, int e) throws NegativeExponent { if (e < 0) throw new NegativeExponent(); coef = c; expo = (coef == 0) ? 1 : e; } I also have an equals method in the same class like … | |
Hi, I'm having some trouble writing a method to sort a LinkedQueue ADT. I find it difficult to keep track of the order things when sorting is concerned (ha ha ha). I'm trying to pull the values out of a Queue which store objects of type PrinterItem. Those objects in … | |
I am making a project using hashtables. I have to use a linked list to handle duplicate hashcodes. The Objects that I am turning into hash tables are State objects with just a String name. I have debugged and tested my entire project and cannot figure out why it is … | |
Hi all - I need to read a text file using a scanner class that has the following format: 5 5 5 5 5 5 5 0 0 0 0 5 5 5 0 5 5 5 0 0 0 5 5 5 5 0 0 2 0 The first … | |
Hi, I am creating a simple game and I my game thread and my player2 thread seem to be executing twice each time the Thread.Sleep() expires. This is the output: Starting game: Player 2 thread Game thread Starting game: Player 2 thread Game thread Player 2 thread This is the … | |
Hi guys, i dont think im using the boolean and break correctly i need it to see the tutormin>=240 and then throw the error and stop without exiting the program. can someone take a look and help me edit it import java.awt.*; //imports all Java.awt import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import … | |
Using java, I need to parse a json text file that will contain data according to the layout shown below. The number of email addresses per store will vary. The point is to get a list of stores & corresponding email addresses, then send emails to the addresses. I have … | |
Hi, I am really struggling with a bufferedReader method i am trying to implement. I have to read text from a file like this : Poland Franciszek,Smuda,63,2009 1,GK,Wojciech,Szczesny,22,11,0 2,DF,Sebastian,Boenisch,25,9,0 3,DF,Grzegorz,Wojtkowiak,28,19,0 4,DF,Marcin,Kaminski,20,3,0 5,MF,Dariusz,Dudka,28,65,2 6,MF,Adam,Matuszczyk,23,20,1 and store it in an array of objects (mine being an array of Player objects which stores … |
The End.