35,618 Topics

Member Avatar for
Member Avatar for ciobanu.alexandru.cristian

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 …

Member Avatar for ciobanu.alexandru.cristian
0
210
Member Avatar for mehnihma

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

Member Avatar for mehnihma
0
233
Member Avatar for marek2121

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 …

Member Avatar for NormR1
0
109
Member Avatar for marek2121

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 …

Member Avatar for NormR1
0
822
Member Avatar for amahmoud

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 …

0
73
Member Avatar for <M/>

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 …

Member Avatar for <M/>
0
80
Member Avatar for amahmoud

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 …

Member Avatar for NormR1
0
168
Member Avatar for germainelol1

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)); …

Member Avatar for NormR1
0
338
Member Avatar for littlebit12

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 …

Member Avatar for NormR1
0
136
Member Avatar for kedxu

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 …

Member Avatar for NormR1
0
240
Member Avatar for Monkey101

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

Member Avatar for NormR1
0
693
Member Avatar for KRUX17

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"); } …

Member Avatar for NormR1
0
256
Member Avatar for crownedzero

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 …

Member Avatar for crownedzero
0
262
Member Avatar for amahmoud

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 …

Member Avatar for NormR1
0
40
Member Avatar for KRUX17

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; }

Member Avatar for KRUX17
0
296
Member Avatar for harinath_2007

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 …

Member Avatar for stultuske
0
298
Member Avatar for dana.persad.5

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 …

Member Avatar for javabitch.04
0
134
Member Avatar for Arabian filly

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

Member Avatar for NormR1
0
120
Member Avatar for Viped

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

Member Avatar for NormR1
0
405
Member Avatar for mukiibi

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 …

Member Avatar for bibiki
0
225
Member Avatar for thompsonSensibl

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

Member Avatar for thompsonSensibl
0
242
Member Avatar for william.bishop.7169

Consider the following: for (int counter = 1; counter < 1; counter -) How many times will the loop execute?

Member Avatar for rohit.deshmukh2009
0
128
Member Avatar for germainelol1

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 …

Member Avatar for JamesCherrill
0
502
Member Avatar for Goldfinch

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 …

Member Avatar for Goldfinch
0
159
Member Avatar for taylor.mitchell.353

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 …

Member Avatar for taylor.mitchell.353
0
703
Member Avatar for ThisIsMeOrIsIt

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 …

Member Avatar for ThisIsMeOrIsIt
0
2K
Member Avatar for Skeldave

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 …

Member Avatar for Skeldave
0
1K
Member Avatar for jamesperkins0

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 …

Member Avatar for jamesperkins0
0
205
Member Avatar for spowel4

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 …

Member Avatar for boobalan006
0
273
Member Avatar for bhutchison

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 …

Member Avatar for JamesCherrill
0
99

The End.