32,199 Topics

Member Avatar for
Member Avatar for VernonDozier

Hopefully this is fairly basic. I've never used enumerated types in Java. I'm sort of trying to take my C concept of them and make it work in Java. Basically use them as constant integer values. That might be putting the square C block into the round Java hole. I'm …

Member Avatar for VernonDozier
0
142
Member Avatar for seacase

I seem to have hit a wall with implementing my own version of merge sort. I can sort the list fine in ascending order, but once I try to reverse the ordering (passing in a boolean), I get an ArrayIndexOutOfBounds error. I'm guessing that what I'm experiencing is some sort …

0
43
Member Avatar for eggmatters

I posted this on Oracle Forums to the sound of crickets chirping. This question entails more Oracle specific tasks then java but since my code is in java, here goes" Hello, I have a java package where I am attempting to implement a database Change notification registration and listener. I …

0
149
Member Avatar for jaredleo999

public class Welcome extends JFrame { private Toolkit toolkit; private static String passy = "123456"; public Welcome() { setSize(300,550); setTitle("Welcome"); setDefaultCloseOperation(EXIT_ON_CLOSE); JPanel panel = new JPanel(); getContentPane().add(panel); panel.setLayout(null); JLabel label = new JLabel("Enter Password"); JPasswordField password = new JPasswordField(6); password.setEchoChar('*'); password.addActionListener(new AL()); label.setBounds(0,0,300,25); password.setBounds(100,0,200,25); JButton b1 = new JButton("1"); b1.setBounds(0,100,100,100); …

Member Avatar for jaredleo999
0
646
Member Avatar for teen-omar

Hey guys, I'm stuck at a problem. Check out the code: [CODE]import java.util.*; class testAll { public static void main(String[] args) { Scanner input = new Scanner(System.in); ArrayList pointsArray = new ArrayList(); ArrayList linesArray = new ArrayList(); System.out.println("Enter amount of sides: "); int sides = input.nextInt(); if (sides <= 2 …

Member Avatar for teen-omar
0
252
Member Avatar for anjal_pawar

On line no 1 there are 1 star On line no 2 there are 3 stars On line no 3 there are 5 stars On line no 4 there are 3 stars On line no 4 there are 3 stars On line no 5 there are 1 stars * *** …

Member Avatar for javaAddict
0
121
Member Avatar for scratchwiz

[CODE]private void eaddbtnActionPerformed(java.awt.event.ActionEvent evt) { if(eaddbtn.getText().equals("Add")){ eaddbtn.setText("Save"); eupbtn.setVisible(false); // edeletebtn.setVisible(false); ecanbtn.setText("Cancel"); } else{ Enrollment e = new Enrollment(eid_txt.getText(),ecode_txt.getText(),egrade_txt.getText() , emarks_txt.getText() ); // ERROR APPEARS IN HERE e.SaveEnrollment(); } } [/CODE] i want to add int value to mysql database...how can i do that? how to convert int value to string …

Member Avatar for scratchwiz
0
146
Member Avatar for selenask

I need to write a program that displays 50 priome numbers . I need to use a stack to store prime numbers.This is what I hava so far I need some help Please. My while loop is weird

Member Avatar for BestJewSinceJC
0
54
Member Avatar for beginner233

Okay I have managed to finish everything. However, my output for average minutes and average hours is wrong for some reason. I have looked over my code multiple times and I cannot figure out what the problem is. I would appreciate any help. Here is my code. Can you tell …

Member Avatar for BestJewSinceJC
0
81
Member Avatar for nikolaos

I have a public class change which holds the private static int [B]commonresource[/B] and the methods : public synchronized void [B]increment[/B](int inc) public synchronized void [B]decrement[/B](int inc) to handle the variable commonresource I have a main class which starts 2 new threads "nikos" , "fosses" with a constructor that takes …

Member Avatar for JamesCherrill
0
109
Member Avatar for wishk

hi guys , i am trying to use flex in java , can any boday help me guiding it . and how to send data safely to server

Member Avatar for masijade
0
54
Member Avatar for luvthug

I am having problem with the following code `public void grow(int size)`, can't seem to get it working import ou.*; import java.util.*; /** * Class DiscoLight * This class uses the Circle class, and the Shapes window * to simulate a disco light, that grows and shrinks and * changes …

Member Avatar for drohnwerks
0
586
Member Avatar for rena0514

my previous button does go to the previous file: [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; public class StudentAddress extends JPanel { private JButton submit, clear, next, display, previous; private JLabel first, last, street, town,state, zip; private JTextField fName, lName, hStreet,hTown,hState, hZip; private int studentCount=0, displayCount=0, i; //studentCount …

Member Avatar for moutanna
0
101
Member Avatar for gunjannigam

I have a 2D image of a map. What I want to do is 1) Paint this image in a 3D Canvas. And then rotate it with the help of mouse 2) Secondly do some path planning, i.e If I select 2-3 points in space on top of that map …

Member Avatar for cmliu2004
0
82
Member Avatar for brechtjah

Hello everyone I'm currently following a course "Game Development" where we learn everything from design to 3d drawing to programming. The language we use is C++, however I'd like to learn Java as well and have there for decided to create a large project (together with a number of other …

Member Avatar for cmliu2004
0
158
Member Avatar for beginner233

Hey guys, how would I happen to utilize a System.out.printf statement to make three columns with the three headings.

Member Avatar for jwenting
-1
126
Member Avatar for dyladalyla

hello all friends i need your help in java.library.path setting.i use a TPM/j API to develop an application using Trusted Platform Module (TPM) specification and to use TPM/j API i need to set java.library.path and load TBSProxy.dll. I try to set java.library.path using DOS and it not works. C:\Users\lfgs\tpm\tpmj>java -Djava.library.path=C:\Users\lfgs\tpm\tpmj\lib\ …

Member Avatar for dyladalyla
0
143
Member Avatar for bufospro

Hi, I am trying to learn creating my exceptions in java. My classes are : [CODE] public class Test { public static void main(String args[]) { Test et = new Test(); int x1=5; int x2=0; try { et.printResults(x1, x2); } catch (DivideByZeroException dbz) { System.out.println(dbz.toString()); dbz.printStackTrace(); } finally { System.out.println("The …

Member Avatar for bufospro
0
114
Member Avatar for hardik.rajani

Hi. I need to create a bean class from list of properties in property file. So that if i need more fields in bean i don't need to go and change code. Instead just add a property in file and at runtime, a field with given name be added to …

Member Avatar for nikelin
0
93
Member Avatar for xsach

i need to find all the files in the directory and sub directory that have a text file..within this text file there is a string called average with some value.. the code below works fine for a single directory...but i need to find the same text files in the sub …

Member Avatar for xsach
0
111
Member Avatar for Dark Master

hi forum, i am using an arraylist for storing a list of objects.i dont want the objects in the list to be ordered but the list should be duplicate free.how can i achieve this.plz help quickly.provide source code if possible.thanks in advance.

Member Avatar for jwenting
0
267
Member Avatar for pirateninja1111

so i need some help, have random int that decide which values in my Boolean array are true. All th [CODE] System.out.println ("pick a number 1-9"); int guess; for ( int i = 0; i < 9; ++i ){ guess = console.nextInt(); if (x[i] = true) { System.out.println("CORRECT!!"); }else if …

Member Avatar for pirateninja1111
0
92
Member Avatar for beginner233

Hi I would really appreciate if someone could tell me what I am doing wrong. I think I have a major error but I can't seem to find out where it is =( My assignment is due tomorrow so if anyone would be up right now and could tell me …

Member Avatar for BestJewSinceJC
0
161
Member Avatar for hasrule

Dear fellow programmers, I had tried and successfuly created JVM and used JNI from C++ executable. But when I change my C++ executable into a shared library (.so, in UNIX) like this [CODE] extern "C" int callFromFakeSID(char* name) { JNIEnv *env; JavaVM * jvm; env = UART_Display_Java::create_vm(&jvm); if (env == …

0
69
Member Avatar for Danny_501

Hi all, Im using hibernate in netbeans to map to a mysql database, but am having problems.... when I open a session: [CODE]Session session = SessionFactoryUtil.getInstance().openSession(); session.beginTransaction();[/CODE] it prints out this in the console:... [COLOR="Red"]12/04/2010 9:50:26 AM org.hibernate.cfg.annotations.Version <clinit> INFO: Hibernate Annotations 3.3.1.GA 12/04/2010 9:50:26 AM org.hibernate.cfg.Environment <clinit> INFO: Hibernate …

0
98
Member Avatar for Swingjohn

I just cannot figure out what is wrong, so tried. Can someone please help me so I can finish this today or tomorrow please. [code] //adds all 10 panels together this.add(mainpanel); //set see the frame setVisible(true); } JOptionPane.showMessageDialog(null,"Oringinal Balance = $" + recieveAmount + "\nPayment#" + x + "\nMonthly Payment$" …

Member Avatar for Swingjohn
0
87
Member Avatar for seacase

I am having trouble adding the ability to order an integer array in both ascending and descending order. I have implemented the functions myself and am having trouble figuring out how to order them in reverse order. I am passing in a boolean variable to test which direction the array …

0
113
Member Avatar for mincus

Hi i have been trying to get a GUI in BlueJ working properly but i hav come across a prolem, i hav 2 buttons which i want to use but when i click them the actionListener wont run my methods. In the action preformed bit i tried to make it …

Member Avatar for llemes4011
0
141
Member Avatar for pateldeep454

My main.java [CODE] public static void main(String[] args) { // TODO code application logic here Rational x = new Rational (); x.num = 2.0; x.den = 3.0; System.out.println (x); Rational.negate (x); Rational y = new Rational (1.0, 3.0); System.out.println (Rational.invert (y)); } [/CODE] My rational.java [CODE] package rational; public class …

Member Avatar for harry010
0
639
Member Avatar for KSUliz

[code=java] import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.text.*; import java.util.*; public class Transfer extends JFrame implements ActionListener { //Declare output stream DataOutputStream output; //Construct a panel for the fields and buttons JPanel fieldPanel = new JPanel(); JPanel buttonPanel = new JPanel(); //Construct labels and text boxes JLabel …

Member Avatar for KSUliz
0
127

The End.