32,199 Topics

Member Avatar for
Member Avatar for caswimmer2011

Hello, I am trying to add audio files to my program. I am using a desktop application and not an applet. All the code that i have found online is for an applet. Is there a way for me to add audio code to a desktop application and not an …

0
95
Member Avatar for z00t

I'm trying to construct a rectangle & compute its area using the getWidth & getHeight methods.. but i cant figure out for to construct a freakin rectangle!! I keep getting the same error when i go to complie it.. no matter how hard i try :p "Cannot find symbol" [CODE]import …

Member Avatar for ajst
0
156
Member Avatar for oppie204

I need help making a code usig bluej to make a program that throws 2 dice for you and if you get a 2 or 12 you lose and a 7 or an 11 you win on the first roll only. And after that they have to roll the same …

Member Avatar for ajst
0
122
Member Avatar for FlavaK

[CODE] public class ProcessResults { private static int[] PayNum; private static String[] Surname; private static String[] FirstName; private static String[] DoB; private static String[] Dept; private static Scanner keyboard = new Scanner(System.in); private static int NumStaff; public static void main(String[] args) { final int MAX_STAFF = 10; PayNum = new …

Member Avatar for FlavaK
0
128
Member Avatar for warlord902

I configured a logger namely "My Log" in my main class which can write errors in a log file named mylog.txt Now I want to use this same file for all packages and classes there in. I tried to put this in other class Logger.getLogger("My Log") //Did nothing Now what …

0
130
Member Avatar for DragoDraco

I could sure use some help. Here is what I have and it shows a problem which is : int tempCelcius = (int)((Double.parseDouble(tempTextField.getText())) (5 / 9) × (Fahrenheit – 32)); and here is all that I have: /** * * @author TJ */ public class FahrenheitConverterGUI extends javax.swing.JFrame { /** …

Member Avatar for masijade
0
124
Member Avatar for Gsterminator

so i'm created a program that display the name and grade of students from a file, and also a boolean that checks to see if the names are in alphabetical order. The problem is that i've created a files that has a name in alphabetical order but it still returns …

Member Avatar for Gsterminator
0
142
Member Avatar for Poonam Mehta

hi i m doing thesis work and the title is to make a simulator for process schduling in any language. if anybody knows anything about it then plz help me.

Member Avatar for chadz mutia
0
139
Member Avatar for haribasker

[CODE]public void actionPerformed(ActionEvent ae) { if(ae.getSource()==clear) { tname.setText(""); tpass.setText(""); } else { if(ae.getSource()==Admin) { try { a=tname.getText(); b=tpass.getText(); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:vote"); Statement st= con.createStatement(); ResultSet rs; rs=st.executeQuery("select * from votelogin where tname='"+a+"'and tpass='"+b+"'"); while(rs.next()) { aa=rs.getString(1); bb=rs.getString(2); } if(a.equals(aa)&& b.equals(bb)) { JOptionPane.showMessageDialog(this,"INVALID USER.TRY AGAIN"); System.out.println("invalid user"); } else { JOptionPane.showMessageDialog(this,"VALID …

Member Avatar for naief
0
110
Member Avatar for Sparky_

Greetings - I'm new to JAVA. I'm using NetBeans. I've been going through tutorials and examples - with some frustration. Question - when I find an example / tutorial to attempt, how do I "create" correctly the setup before I simply paste the code? Meaning if the example has: [CODE]public …

Member Avatar for DarkLightning7
0
124
Member Avatar for basketball8533

Hey guys can you help me convert this code into java... i started a little... [CODE] def minEditDistR(target, source): """ Minimum edit distance. Straight from the recurrence. """ i = len(target); j = len(source) if i == 0: return j elif j == 0: return i return(min(minEditDistR(target[:i-1],source)+1, minEditDistR(target, source[:j-1])+1, minEditDistR(target[:i-1], …

Member Avatar for DarkLightning7
0
183
Member Avatar for javanoob101

Hello! I have to make a "Dice Applet" for school. It is all finished but the dice pictures do not display properly. It only appears in a line (not the full image.) But they seem to display fine if you maximize the applet then restore the applet to its original …

Member Avatar for javanoob101
0
131
Member Avatar for sirlink99

Hello Everyone. I am trying to use a string to set a color. i have tried Color is the string which says a color like black or red [code] g.setColor (Color.color); [/code] and [code] g.setColor (Color."color"); [/code] lets say the string color was red it should have this effect [code] …

Member Avatar for sirlink99
0
7K
Member Avatar for Neversleepin

Hello, in java, if we want to extract all values between 10 and 100, how could we express between in java. Is there any symbol like && || ..? Thank you

Member Avatar for Ezzaral
0
81
Member Avatar for LianaN

Hi! I need my own file extension for SWING desktop application (image processing tool). In fact, I want a user to be able to save locations of JLabel components on a screen. Please, give me a hint on how to implement this task. Thanks!

Member Avatar for LianaN
0
160
Member Avatar for LianaN

Hi! I'm trying to create borders around JLabel components. However, the line [ICODE]c[i].setBorder(border)[/ICODE] cannot be compiled. Please, help me to improve this code. Thanks! [CODE] public void mouseReleased(MouseEvent e) { if (Menu.getgroup()) { Component[] c = getComponents(); Border border = LineBorder.createGrayLineBorder(); for(int i = 0; i < c.length; i++) { …

Member Avatar for LianaN
0
92
Member Avatar for basketball8533

Hey guys can you help me convert this code into java... i started a little... [CODE] def minEditDistR(target, source): """ Minimum edit distance. Straight from the recurrence. """ i = len(target); j = len(source) if i == 0: return j elif j == 0: return i …

Member Avatar for DecreaseEntropy
0
148
Member Avatar for lexflash

I m planning to create a web based system in which I need to allow users to upload videos and photos into my database and to display that video or photo which they request. I m more comfortable working in java, so i have placed my query here. I would …

Member Avatar for lexflash
0
141
Member Avatar for hanslim77

I'm trying to run audio in a different thread but I have no idea why but when I call wait(), my entire program seems to wait or hang.. not sure if it's deadlock since all it does is wait(), though if I set a time period, after that period it'll …

Member Avatar for hanslim77
0
212
Member Avatar for Sunshineserene

Hi all. I'm having a problem to represent or use a variable as an int. [CODE]Color c = new Color(255, 0, 0); int y = c.getRGB(); for (int v = 0; v < h; v++) { for (int u = 0; u < w; u++) { int x = image.get(u, …

Member Avatar for masijade
0
138
Member Avatar for Neversleepin

Hello, here is a code for retrieving some lines from a text file. i'd like to extract data from line2 to line4 ---> this is working but in the same time i want to data from Line10 to line12 here is the code, my conditions is not working: Thank you …

Member Avatar for Neversleepin
0
165
Member Avatar for Climber Ty

I am working on an ATM machine project for my college class. It's in its early stages but here what I have so far. [CODE] /** * * @author Ty */ import java.util.Scanner; public class Main { private double currentBal =1000; Scanner input = new Scanner(System.in); public void mainMenu(){ int …

Member Avatar for Climber Ty
0
8K
Member Avatar for lisaroy1

Java is very interesting language and important language To learn JAVA roseindia.com is also a very good site

Member Avatar for peter_budo
-1
103
Member Avatar for nizam27391

hi.. i just want to know.. is there any shortcut key to run the main apps of java in bluej.. if compile i can use ctrl+k.. but what about to run it? i'm tired having to right click and pick [CODE]void main(String[] args)[/CODE] Thanx in advance guys...

0
73
Member Avatar for nizam27391

well.. back to c and c++,we can used pointer to access the memory address of data. But how to access memory address in java? i do search at daniweb and found this post.. [url]http://www.daniweb.com/forums/thread140991.html[/url] but it not happen with my program.This is my program. [CODE]Node x = new Node(new Integer(4)), …

Member Avatar for masijade
0
239
Member Avatar for saveme123

How do you write a method that switch a space " _ " with a letter, the example my teacher gave us to work with is: [CODE]public static int seqSwapSearch ( int[] list, int item) { int location = -1; int temp; for (int i = 0; i < list.length; …

Member Avatar for code learner
0
89
Member Avatar for Sonny101

Hi all, I am currently attempting my first project for programming using Java. One of the classes I have made contains 3 constructors, now I remember learning a little about the [I]this[/I] keyword and thought it may be appropriate here, however, I am not completely sure on how to use …

Member Avatar for lisaroy1
0
125
Member Avatar for Latvija13

I don't understand how to check for non-alpha characters in a string that has more than one word. I'm basically asking for a retype if the string has more than 3 words or if it has non-alpha characters. I'm wondering if Character.isLetter is not what I'm looking for since it …

Member Avatar for JamesCherrill
0
122
Member Avatar for ubi_ct83

hi, lets say i have 2 classes 1 is to process the data and another 1 is to connect to mysql. P.java to process the data and Connection.java to connect to mysql.i use JDBC to connect and pass the data through constructor P way=new P(String side).after process the data, i …

Member Avatar for ubi_ct83
0
101
Member Avatar for reyarita

ALGORITHM TO LOAD A JOB IN A FIXED PARTITION 1. Determine job's requested memory size 2. If job_size > size of largest partition Then reject the job print appropriate message to operator go to step 1 to handle next job in line else continue with step 3 3. Set counter …

0
79

The End.