32,204 Topics

Member Avatar for
Member Avatar for 47pirates

I need to update the items of JCombobox from the database during runtime. I had made the JCombobox editable and what i need to do is type something in the editable combobox and search the database and only display the items matching the text. For example there are if i …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Valiantangel

I am getting the following error,"The static field IntegerSet.a should be accessed in a static way" `public static IntegerSet union(IntegerSet setA, IntegerSet setB){ IntegerSet u = new IntegerSet(); for (int i=0;i <= CAPACITY; i++) if (a[i]==true || setB.a[i]==true)// u.a[i]=true; return u; My Class is as followed: public class IntegerSet { …

Member Avatar for JamesCherrill
0
362
Member Avatar for joe_ojah

hi everyone, i am new to netbeans. i am creating a system that can allocate rooms to students. My main problem is how to find out which rooms are full and which ones are available. I am using Mysql and Java Netbeans. I have read some of the tutorials but …

Member Avatar for ali.nazia999
0
2K
Member Avatar for BestJewSinceJC

Since I keep seeing people asking how to read the Integers from a File, I figured this simple snippet might be useful. What it does is it creates a new Scanner Object based on the File Object "test.txt" then it reads all of the Integers from that file, skipping over …

Member Avatar for Ezzaral
0
5K
Member Avatar for Jdan2388

Hi, Im really new to java and i'm trying to write a simple rock paper scissors game, and i'm having a problem. I have to incorporate a JOptionPane three button box where the user selects either rock, paper or scissors. The problem is that i don't think im retrieving the …

Member Avatar for Jaggs
0
873
Member Avatar for GeekTool

In the book i use, a craps game is the project. Here is the code: import java.util.Random; public class Craps { private static final Random randomNumbers = new Random(); private enum Status { COUNTINUE, WIN, LOST }; private static final int SNAKE_EYES = 2; private static final int TREY = …

Member Avatar for ~s.o.s~
0
3K
Member Avatar for baseballer

Hi, I need some help coming up with an algorithm that will return class 1, 2, or 3 based on the year that is entered. I have an example that works but I need something a little more simple. `function senateclass (cycle) { return 3 - ((cycle % 6) % …

Member Avatar for baseballer
0
118
Member Avatar for xGiraffe

I have trouble trying to create a clock java program that asks for user's input for hours and minutes. When it asks the user for their input, the clock program is suppose to set it to that time using the hour hand and the minute hand, but for some reason …

Member Avatar for JamesCherrill
0
430
Member Avatar for SuperManofBC

Simple Sound Player Goal The goal of this assignment is to implement a simple sound player. The application has been partially implemented, and you need to complete the missing bits. When you open the project, you will see the class structure depicted below. Three of the classes are fully implemented …

Member Avatar for stultuske
0
635
Member Avatar for gispe

Hi, Im trying to insert to a table in sql that is related to another by a foreign key. The first table has an ID, a suppliers id and a date; and the other table has an ID (that for some records should have the same id from the other …

0
124
Member Avatar for rtellez700

I was wondering if it is possible to export a project in eclipse as a jar file but that doesnt include the .java source code files. For example, say i wanted to distribute my program to others but didnt want them to be able to alter my .java source codes. …

Member Avatar for JamesCherrill
0
266
Member Avatar for frank85

Need assistance with formatting the output; everything prints out in one line. I want the output to look more like a letter firstname lastname 123 main street miami, oh 90210 Dear firtname lastname, text text text more text more text sincerily, blah > /public class Letter { > > /private …

Member Avatar for JamesCherrill
0
107
Member Avatar for anisha.silva

hi i did not know which category this would go under so posted under java. any idea on what are the timing schemes for process coordination?

0
54
Member Avatar for moussa_90

i have java programming course as an elective course and i have aproject could u help me plz?

Member Avatar for JamesCherrill
0
38
Member Avatar for hyung101

**How am I going to split a line of strings ang put it into an array if the strings are arranged into columns, just like the attached file then compare the first column with user's input..? **

Member Avatar for hyung101
0
399
Member Avatar for Valiantangel

1.Create class IntegerSet. Each IntegerSet object can hold integers in the range 0-100. The set is represented by an array of bools. Array element a[ i ] is true if integer i is in the set. Array element a[ j ] is false if integer j is not in the …

Member Avatar for JamesCherrill
0
852
Member Avatar for hoopd505

I'm making a Riemman sum code for a school project but I keep getting this error at line 37. The line is in the for loop after the statement "String coord2;". String message, message2, numStr, numStr2, numStr3, numStr4, numStr5; double a, n, xmin, xmax, w, w2, w3, w4, w5, area, …

Member Avatar for wen_cai
0
251
Member Avatar for jwings

protected void addBindings() { InputMap inputMap = this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); ActionMap actionMap = this.getRootPane().getActionMap(); KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_Z, Event.CTRL_MASK); inputMap.put(key, "undo"); actionMap.put("undo", new UndoAction()); key = KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK); inputMap.put(key, "completed"); actionMap.put("completed", new CompletedAction()); key = KeyStroke.getKeyStroke(KeyEvent.VK_D, Event.CTRL_MASK); inputMap.put(key, "delete"); actionMap.put("delete", new DeleteAction()); } class UndoAction extends AbstractAction { @Override public void actionPerformed(ActionEvent …

Member Avatar for JamesCherrill
0
97
Member Avatar for enakta13

I have made a keyTyped event java program. Now it display square for each single number i typed through keyborad. **What i want is this:** 1. when i type 1 answer to be displayed 1 2. Again when i type 2 answer to be 144, not 4. So any Idea …

Member Avatar for stultuske
0
177
Member Avatar for godzab

Hello guys, I need help with the Robot class in Java. I am trying to excute a couple of keystrokes using an array so it will be less repetitive typing in the keyPress method. Here is the code: import java.awt.AWTException; import java.awt.Robot; import java.awt.event.KeyEvent; import java.io.IOException; public class RobotExp { …

Member Avatar for godzab
0
962
Member Avatar for james chaco

Hello, I want to develop an email system (preferably through java but any other language will also do), say mymail.com, exactly like gmail, yahoo, hotmail or any other mailing system where users can send and receive a mail. I would like to know where can i start from. Thanks in …

Member Avatar for godzab
0
239
Member Avatar for malsmit2014

I am not totaly sure my code for my revealLetter is correct....I can't quite convert letter string into an char array so i just left it as hiddenWord == letter in the code.... package program.p02; public class WordHider { private String hiddenWord; private String partiallyFoundWord; private int NUMBER_MISSES = 5; …

Member Avatar for stultuske
0
208
Member Avatar for malsmit2014

package program.p02; import java.io.*; import java.util.*; import java.lang.*; public class Dictionary { private String[] dictionary; private static final int NUMBER_OF_WORDS = 81452; private static String FILE_NAME = "dictionarycleaned.txt"; //no arg constructor??? public Dictionary() { Scanner fin = null; //open and test the stream try { fin = new Scanner(new File(FILE_NAME)); …

Member Avatar for JamesCherrill
0
188
Member Avatar for kng9

Hello everyone, Im new to this forum and sort of new to Java aswell. I'd like to ask you to comment on the way I practise Java and also hopefully solve this **"Start: Applet not initialized."** error. I have not tried to run this through browsers because i didn't create …

Member Avatar for kng9
0
156
Member Avatar for nHulk

Below code includes both client and server code.... I am trying to read message from client and display it on server and vice versa......Problem i am facing is both the codes are executin but messages are not getting displayed ....help me import java.io.*; import java.net.*; class Client { public static …

Member Avatar for NormR1
0
292
Member Avatar for SuperManofBC

public String getCurrentDay() { if(day.getValue() == 0) { return "Sunday"; } if(day.getValue() == 1) { return "Monday"; } if(day.getValue() == 2) { return "Tuesday"; } if(day.getValue() == 3) { return "Wednesday"; } if(day.getValue() == 4) { return "Thursday"; } if(day.getValue() == 5) { return "Friday"; } if(day.getValue() == 6) { …

Member Avatar for stultuske
0
213
Member Avatar for jwings

Now I have 2 classes. The first one is called UIController and the other one is called MainJFrame. I would like to know how to make a listener for a JFrame which has a JComboBox inside. Everytime a ComboBox submit a new data the JFrame will tell the UIController that …

Member Avatar for JamesCherrill
0
91
Member Avatar for profyou

i have been confused lately regarding where to concentrate... java or c++ or Algorithms & data structures or ........(there are still more languages) whenever i concentrate on java i tend to forget c++ or various algorithms or assembly( i have learned 8086/8088 programming). java is very large...core java......file io....swing..servlets....enterprise java...and …

Member Avatar for jackbauer24
0
284
Member Avatar for Jdan2388

hi i'm having trouble with this rock paper scissors program looping correctly. Ok so first of all that game is a simple rock paper scissors of the user against the cpu. The program begins by asking the user what choice he/she would like from a dropdown menu rock. paper or …

Member Avatar for NormR1
0
191
Member Avatar for JavaPadawan

In this program I'm attempting to visually represent a selection sort using an array of rectangle objects. If the program worked as intended, the rectangles would sort themselves from least to greatest, with two rectangles switching spots and the array being repainted each time through the selection sort loop. As …

Member Avatar for wen_cai
0
228

The End.