32,199 Topics
| |
i have a Life class. which just prints a image of heart. i want to have 6 lifes so iam adding 6 classes in arraylist. 1st heart one left. 2nd heart next to it..... int life = 6; //LIFE - create 6 heats and store in arraylist lifeClass = new … | |
Using this example json file: { "stores": [ { "storeName":"AUGUSTA", "company":"CC", "emailAddresses": ["spowel4@gmail.com", "spowel4@yahoo.com", "steve@compsysplus.com"] }, { "storeName":"CHATTANOOGA", "company":"CC", "emailAddresses": ["spowel4@gmail.com"] } ] } I have this code to try to parse the file: public static void main(final String[] args) throws Exception { // TODO code application logic here ObjectMapper … | |
Hey Fellas, I created 10 JTextFields using and ArrayLists: `ArrayList<JTextField> textFArray = new ArrayList<>();` textFArray.add(new JTextField()); gbc.gridx = 1; for (int i = 0; i < 10; i++) { gbc.gridy++; add(textFArray.get(i), gbc); textFArray.add(new JTextField(i)); } What I need to do: I need to get the values of what ever the … | |
i have two classes, enemy class and level class. in level class i am changing the counter value. note i set up my if statment so it will only goes in onces and never again. so if u reach lvl 2 than it will go in lvl2 if statment onces … | |
Hello! I use the Serializable interface in one of my projects but I have a problem. I serialize some objects and when I try to deserialize them after I run the application several times, the only object that is deserialized is the last one that was serialized. Do you have … | |
Hello guys i have started project that i want to translate text from Latin to Cyrillic so i have just this and i dont know how to continue any help will be appreciated - Thanks :) private void TranslateActionPerformed(java.awt.event.ActionEvent evt) { String TextToTranslate = textToTranslate.getText(); char[] latinica = { 'a', … | |
I have created a simple UDP client and server, but I have some problems with how to actually structure the servers operational handling, whether its if Else or case selections. 1.The user sends a Packet to the server, containing a string that they've typed in. 2.The server receives it and … | |
Hi to all, i am newbie in java. I have created a program to read data from excel files with APACHE POI and show them in my console. I am using Eclipse as editor. Now I an trying to import these data in database so I can store them. The … | |
Hi chaps, what do we define as a client of a class please? I keep reading about "clients of a class" but I don't understand what that means. Maybe it is better to have some examples: take the following 2 files: //Employee.java public class Employee{ public static void main(String[] args){ … | |
how hard is to learn object-c, if you know java. i want to build online games in java and build apps in object-c. i want to switch between them fast. can you give some idea how same or different are those language are? | |
Ok so i have implemented a program that simulates a post offie, but now i cant figure out why my threads arnt join and printing, also not sure why my threads are not interleaving. Anyone care to take a look at my code?, its kinda long thats why i dint … | |
Hello, Iv recently been having trouble with a java project im working on as i need a button to add a sentence to a Swing list box. The problem im having is it uses an observable class and an observer. Fundamentally the list adds the elements to an array in … | |
Whenever I try to run this nothing happens. Does anyone know what's wrong? package hobbits; public class Hobbits { String name; public static void main(String[] args) { Hobbits []h = new Hobbits[3]; int z = 0; int x = 0; while (z < 4){ h[z] = new Hobbits(); if (z … | |
Hey guys, I'm making a hangman project just for fun, and i was wondering if you could help me. * I have 5 classes * class 1- main (basically controlls everything except recognizing where the letters are located in the word and printing the hangman picture) * class 2- char_array … | |
Ok so I'm using a buffered reader to read a file and it works alright but my problem is I have integers in this file I have to find and place into an array and I don't know how to do this(feel so stupid). I'm trying to work on a … | |
Sorry for my poor english as i'm not a native english speaker and writer, but i have written a code which calculates big numbers, adding subtracting and multiplying. when multiplying, adding and subracting numbers, it works, but when i try adding 0 to 0 or subtracting 0 to 0 or … | |
Hello Im trying to send a HTML email but I want to encrust into the HTML a image without it being a attachment. The content of the email is pure HTML so in order to do img src it needs to be a live link AFAIK. If it can be … | |
Hi, I'm having issues with driver class is giving me issues. The code needs 2 for loops requirement. The driver class will create an array of 3 CircusClown objects. Use a loop to get user input for your 3 objects. Use a loop to print the toString() method of your … | |
I need help with implementing grow and shrink Here is the actually instructions---> •grow(). This method, when called, will “grow” arrayStack by utilizing the strategy outlined in 2 above. This method will only be called by push(). Note that grow() should be private. •shrink(). This method, when called, will shrink … | |
My team has been doing Java for a long time. We are switching to Ruby. We are finding that Ruby has limitations and that we have to do certain things in Java. I'm trying to find a way to call Java code from Ruby. I'm searching Google and such, and … | |
Hello, i'm trying to add some values in the database (ms access) but i am having the following error: Error:java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Can somebody help? Here is my code: package db_con; import java.sql.*; /* * To change this template, … | |
which is better for a noob programmer ? netbeans or jcreator? or any other ? please help me thanks in advance | |
Hi I am trying to create a GUI game where you slide your player to obsticals in order to get to the middle. The basic assignment rules are as follows The world should be represented using a 5 x 5 grid. Empty spaces, obstacles, the destination, and the player should … | |
Hello, Would someone be willing to take a look at this segment of code? I am trying to figure out how this segment of code operates. I can see how the program can evaluate a simple prefix statement like + 7 6. I cannot see how the program can solve … | |
This is what I am required to do using basic java programning, I am very new to this and was wondering if someone could help me out from what I have read in my book I am suppose to use if else and decision statements. What O dont understand is … | |
i am pretty new to java i wrote this code but setText doesnt work i mean i cant reset the contol after type a value .what is wrong friends [CODE] private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) { String gelen=jTextField1.getText(); Random rnd=new Random(); int secilen=new Integer(rnd.nextInt(3)); if(Integer.parseInt(gelen)>secilen){ jOptionPane2.setBackground(Color.GREEN); jOptionPane2.setMessage("Girdiğiniz sayı "+gelen +"\n Benim … | |
I am supposed to create a binary tree using strings typed in by the user, to build a balanced tree using recursion. When I type in letters: A, B, C, D, E, F and the output is set up for preorder output, what I am getting is:A B D F … | |
https://www.dropbox.com/s/twtl38huxeeetsx/ProgettoApachePoi.rar in this link there is my project, i create a java text editor for open docx documents. the text editor should do the basics functions of a text editor, as copy, paste , select all, delete, exit, new, open , save and save as. i tested the code and … | |
Okay, so I'm in Progromming 2 for school and I was working on Array List and the next lessons just tells you to use the Fibonacci series. Now it was never mention in any prior lessons or semesters and I'm not exactly sure what it is. I know it has … | |
could anyone please help me write a program which accepts an age and throws an exeception if(18>age>22). |
The End.