398 Posted Topics

Member Avatar for v3ga

[QUOTE=v3ga;1758099]My objective is to implement a GUI calculator in java. I am thinking of passing the expression entered by the user to bc and then get output from terminal and print to user. My question is [LIST=1] [*]How to execute a terminal command from java so that i can pass …

Member Avatar for v3ga
0
358
Member Avatar for newbie14

[QUOTE=newbie14;1759205]I have socket connection which keep reading data and then it will send it via a queue for next processing in another thread. I notice at times it just stop sending data to the queue. I will print this System.out.println("\n\nSending TO QUEUE : "+message); and stop but I do not …

Member Avatar for JamesCherrill
0
377
Member Avatar for riahc3

[QUOTE=riahc3;1759341]Hey I have a folder in my current working path and I want to make a copy of a file inside it to the the current working path. Its kind of a dumb question, I know, but how do it do it? Thank you.[/QUOTE] maybe this:[url]http://edgblog.wordpress.com/2010/02/20/how-to-copy-a-file-in-java/[/url] and this:[url]http://www.java7developer.com/blog/?p=334[/url] and this:[url]http://codingjunkie.net/java-7-copy-move/[/url] …

Member Avatar for riahc3
0
210
Member Avatar for kyriacos1986

[QUOTE=kyriacos1986;1760785]I want to read from the keyboard the first name and last name of a member separated by space I have tried the following but it doesn't work. [CODE] public static void updateWeight() { Scanner in = new Scanner(System.in); // Creation of a new Scanner object String tempName = ""; …

Member Avatar for NormR1
0
186
Member Avatar for Goldfinch

[QUOTE=Goldfinch;1760737]What I'm saying is, I'm trying to see if I can access the values assigned to arrayList in the readFile method from outside readFile when the method is done executing. When I wrote "access assigned," I mean accessing the strings assigned to ArrayList within the readFile method from outside the …

Member Avatar for Goldfinch
0
966
Member Avatar for TIM_M_91

[QUOTE=TIM_M_91;1760777]Hi Guys well what I want to do is instead of within my writeString to set my PLAYCOUNT to '16' what I want to do is every time the statement is executed my PLAYCOUNT is increased by 1. Any help you can give would be appreciated: My code is below: …

Member Avatar for TIM_M_91
0
175
Member Avatar for Webville312

[QUOTE=Webville312;1760489]Hello, all; I have been running a midlet on my computer, however whenever I try to acces the database, I get the following error : javax.microedition.io.ConnectionNotFoundException: TCP open What could be the problem and how can I go about it? Thanx in advance.[/QUOTE] Mind showing some code at the line …

Member Avatar for DavidKroukamp
0
89
Member Avatar for javaa

[QUOTE=javaa;1759132]Hello Every one ... My proplem started before a month and can't get any answer for it .. when i create a java program and need to make it an excutable file .. after done with program that contain's picture's and sound file's I converted it from .java to .jar …

Member Avatar for javaa
0
142
Member Avatar for 1bung100

[QUOTE=1bung100;1759522]I know there are 3 different ways to parse xml - using API - DOM - SAX But i found that in Digester related examples xml parsing is also performed. So I want to know whether Digester is also an xml parser or not? If not what is the main …

Member Avatar for DavidKroukamp
0
144
Member Avatar for krejar

[QUOTE=DJSAN10;1759269]I did not understand your question.It is going in the if statement for the first time according to what output you are getting. I suppose your problem is something else. and Assuming initially value of done was false, so !done evaluated to true and you entered while loop for the …

Member Avatar for DavidKroukamp
0
131
Member Avatar for rushikesh jadha

[QUOTE=rushikesh jadha;1756996]ok. then how to set JPEG image to frame through label.[/QUOTE] see here:[url]http://www.java2s.com/Code/Java/Swing-JFC/CreateaJLabelwithanimageicon.htm[/url]

Member Avatar for rushikesh jadha
0
185
Member Avatar for uurcnyldrm

[QUOTE=uurcnyldrm;1758865]I'm just getting different ideas from different people. If you don't give an ideas or suggestions, why are you trying to make things different??? I won't do what you would say exactly, as I said many times, I'm just looking for something different. It is that simple. Please don't try …

Member Avatar for DavidKroukamp
0
713
Member Avatar for zina_a

[QUOTE=zina_a;1758983]hello, I need help please how can I call the command prompt in a java application,I want to make the prompt command as an option in my application,but i don't know how,can any one help me please and thanks[/QUOTE] Also you could use ProcessBuilder class if you want to pass …

Member Avatar for DavidKroukamp
0
185
Member Avatar for computerdude87

[QUOTE=computerdude87;1758065]Can anyone tell me why I keep getting a value of 0 returned? [CODE] public static void main(String[] args) { double getSum = 0; double getAverage = 0; String num1 = JOptionPane.showInputDialog(null, "Please enter your first number"); String num2 = JOptionPane.showInputDialog(null,"Please enter your second number"); String num3 = JOptionPane.showInputDialog(null, "Please …

Member Avatar for computerdude87
0
127
Member Avatar for kalcio

[QUOTE=kalcio;1756726]hello, I prepare an application uses the result of the command prompt (Runtime.getRuntime (). exec (cmd)) for a command already entered, and displays it in a Textarea, but I notice that if I use a modal box the problem persists, my problem is that this application is in frensh,if any …

Member Avatar for kalcio
0
341
Member Avatar for aanshik

[QUOTE=aanshik;1757783]which one of best in java struts1.3 struts2 Regards [URL="http://www.supportcorporate.com/staff-augmentation.php"]Staff Augmentation Services[/URL][/QUOTE] check here:[url]http://www.javabeat.net/tips/139-struts-10-vs-struts-20.html[/url] and here:[url]http://www.oranda.com/webapp/struts2.html[/url] the newer one is always better i would say...If you dont know either then start with the newer

Member Avatar for DavidKroukamp
0
84
Member Avatar for bloodbender

[QUOTE=bloodbender;1757889]lol, thanks for your reply stultuske, but I know the order of precedence for calculations. That's not what I was asking. If you read my post again, I said So yes, I know x is supposed to evaluate to 7, exactly how you described it, but after that statement ends …

Member Avatar for bloodbender
0
131
Member Avatar for Torf

[QUOTE=Torf;1756644]I'm wanting to convert this part of the pseudo-code... [code] public class program { public static void main(string[] args) { String name =""; String address =""; int item; int quantity; double price; int[] size = new int[6]; [/code] I'm not sure how to do this here... and it looks like …

Member Avatar for Torf
0
160
Member Avatar for adil_bashir

[QUOTE=adil_bashir;1756572]Ihave written the below pieces of code, but i am not able to solve the compilation error here as it shows the error as ArrayOutOfBoundsException error. so please tell me hw to remove the error and please bring the necessary changes. [CODE] import java.util.*; public class Cipher { private int …

Member Avatar for adil_bashir
0
176
Member Avatar for adil_bashir

[QUOTE=adil_bashir;1757229]but what if my input string will be itself a string like this: String input = "adil"; and i want to convert it into int like its ASCII value.[/QUOTE] well you'd first make an int[] thats equal to the size of the string ie string.length() then you'd have a for …

Member Avatar for adil_bashir
0
184
Member Avatar for adil_bashir

[QUOTE=adil_bashir;1757265][CODE] public static void main(String[] ar) { ..... int N = Integer.parseInt(args[0]); ..... } [/CODE] Error is : Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0[/QUOTE] how does this:[code]public static void main(String[] ar)//string[] ar[/code] match this:[code]args[0][/code] im surprised it even compiles

Member Avatar for adil_bashir
0
94
Member Avatar for MrHardRock

[QUOTE=MrHardRock;1757253]Hey everyone, I recently had the assignment to write a recursive program to calculate greatest common denominator. I barely understood recursion when our instructor explained it to us. I understood how it works and calling on itself I am just bad at implementing it. I think I almost got my …

Member Avatar for MrHardRock
0
304
Member Avatar for mehnihma

[QUOTE=mehnihma;1756652]can someone help me how how can catch CTRL C and print it out then stop the program? Thanks [CODE]/** * 218-102 Lab 7 * TestCircle.java * * @author JKang & JLeone * */ import java.util.*; import java.awt.event.*; import javax.swing.*; import java.awt.*; public class TestCircleB { public static void main(String …

Member Avatar for mehnihma
0
9K
Member Avatar for sergent

well i use only Windows 7 x64 as an OS, and Visual Studios for my C# and the occasional c and c++ apps, and netbeans for my java! :)

Member Avatar for hystaspes
0
331
Member Avatar for DJSAN10

[QUOTE=DJSAN10;1756861]I want to create a regular expression that matches with the string "B. Hello" or "C. Hello" and so on.. I tried number of things and finally came up with this [CODE]String REGEX = "[A-Za-z]"+Pattern.quote(".")+" Hello";[/CODE] but still no luck.. I tries using '\s' for space but still not working. …

Member Avatar for DJSAN10
0
179
Member Avatar for TIM_M_91

[QUOTE=TIM_M_91;1756648]Hi guys well I have a problem on my JFrame which is once I click on my List all Videos button it displays my data from my MS database which all works well. However as you can see from the png the query results are not aligned up correctly together …

Member Avatar for DavidKroukamp
0
124
Member Avatar for rushikesh jadha

[QUOTE=rushikesh jadha;1756363]i have created program below ,but it does not run successfully why [CODE]import java.sql.*; public class Bank { public static void main(String[] args) throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // TODO code application logic here try{ Connection cn=DriverManager.getConnection("jdbc:odbc:rushiDSN"); System.out.println("Connected Successfully"); Statement stmt=cn.createStatement(); stmt.executeUpdate("CREATE TABLE Author(AuID Number(3), AuName Char(15), AuAddr Char(30))"); System.out.println("Table …

Member Avatar for rushikesh jadha
0
260
Member Avatar for moe0

[QUOTE=moe0;1756728]Hello I'm writing a little program to check if a postal code is valid or not and I'm using while loop and if statement this is the code: [CODE]final String REGEX = "[A-Z&&[^DFIOQU]][0-9][A-Z&&[^DFIOQU]] [0-9][A-Z&&[^DFIOQU]][0-9]"; output.println ("Please Enter a Valid Postal Code: "); String postal1; String postal2; boolean isCorrect = false; …

Member Avatar for DavidKroukamp
0
75
Member Avatar for jkembo

[QUOTE=jkembo;1756475]I would like to move the mouse cursor from one position to another within a Jtextfield after a condition is satisfied. I do not know what to use. Thank you[/QUOTE] have you checked:[code]int offset; //set int to whatever jtextfieldname.setCaretPosition(offset);//use setCaretPosition() to move the caret to a specific offset in the …

Member Avatar for jkembo
0
644
Member Avatar for MicroD

[QUOTE=MicroD;1756481]Hello guys. I'm wondering is it possible to stream mp3 songs from some site with java? I tried to find something but allways everything what i found was only for reading mp3 songs from local disk. If you know feel free to answer me. - Regards, David.[/QUOTE] Hmm im not …

Member Avatar for RicardoE
0
1K
Member Avatar for dsmith12

[QUOTE=dsmith12;1756548]My professor told me these things are wrong:1) For getting the "#" sign in your board, you need to call the createTicTacToeBoard() method to create the board. The returning type of the method is char[][] createTicTacToeBoard() not the string, and you don't need to pass any array into this method …

Member Avatar for DavidKroukamp
0
155
Member Avatar for adil_bashir

[QUOTE=adil_bashir;1756487]there occured compilation error as: ArrayIndexOutOBoundsException: 3 at passingArray.java:8 at array1.java:8 please help[/QUOTE] because java starts at 0, so if your array length is 3(ie has 3 variables), to get the last index you will use array.length-1. but also see here:[code]int m[] = {2.4,5};//how can 2.4 be an integer? so …

Member Avatar for DavidKroukamp
0
238
Member Avatar for servet

[QUOTE=servet;1756072]Hi! I use scanners delimiter. The next() function for scanner should return me the string by these punctuators: | . : space But i don't know what to write inside scanner.useDelimiter("") parameter? For example for this string "abc.123,zqw ttt|AAA", scanner.next() should return abc scanner.next() should return 123 scanner.next() should return …

Member Avatar for JamesCherrill
0
126
Member Avatar for itsmrshow

[QUOTE=itsmrshow;1756059]I need help, The array in Class Loto generates 6 random numbers and print them out. the Class Lotto askes the user to input 6 numbers which are stored in an array. i need code to compare the two arrays and see if they equal each other, and if they …

Member Avatar for zeroliken
0
219
Member Avatar for marsangel

please see here:[url]http://www.samlogic.net/articles/autorun-enable-disable-nodrivetypeautorun.htm[/url] . however this only applies if you are using windows 7. This is also some cool stuff on autorun infs:[url]http://msdn.microsoft.com/en-us/library/windows/desktop/cc144200(v=vs.85).aspx[/url]

Member Avatar for DavidKroukamp
0
1K
Member Avatar for AMeddaugh

[QUOTE=AMeddaugh;1756128]Okay so my Java teacher isn't very good, and i'm kind of flying solo here. He gave us this project, and one part of the project is throwing up a JOptionPane which allows the user to put input a number which correlates to a specific car. For example How do …

Member Avatar for AMeddaugh
0
150
Member Avatar for dsmith12

Well a break statement needs to be within a loop... so as stultuske said, find the loop that checks if the player has won, and if he has put a break;

Member Avatar for DavidKroukamp
0
195
Member Avatar for adil_bashir

[QUOTE=adil_bashir;1756074]please tell me how to convert an integer type to a String. if possible, give some code?[/QUOTE] Hey please dont just post questions because you like typing... a quick google(with your thread title and an added "java") would have solved this:[url]http://www.java2s.com/Code/Java/Language-Basics/Convertinttostring.htm[/url]

Member Avatar for stultuske
0
171
Member Avatar for adil_bashir

[QUOTE=adil_bashir;1756070]please give some piece of code that will make me understand that how to pass an array to a method/function?[/QUOTE] well lets say we want to parse an int[]:[code]private static method(int[] arr) {//static was used if necessarry }[/code] you'd then call it using:[code] int[] array=new int[5]; method(array);[/code]

Member Avatar for adil_bashir
0
183
Member Avatar for adil_bashir

[QUOTE=adil_bashir;1756053]Since i am new to java, so please tell me that is there any way by which i can convert integer array to primitive int?? if yes, give some code.[/QUOTE] im confused, an integer array should contain an array of integers, and integers are already primitive?... but see here:[url]http://stackoverflow.com/questions/564392/converting-an-array-of-objects-to-an-array-of-their-primitive-types[/url] and …

Member Avatar for adil_bashir
0
254
Member Avatar for adil_bashir

[QUOTE=adil_bashir;1756042]i need to return the ASCII value of the argument passed in the StringtoIntfunc(). But i am not getting the real ASCII values and i think the problem is with the return statements? please help. public class StringIntfc { public int[] StringtoIntfunc(String s) { int j =0; int k[] = …

Member Avatar for DavidKroukamp
0
127
Member Avatar for ringo_tech

[QUOTE=ringo_tech;1755571]hi everybody, i needed to play mp3 audio in my AudioPlayer project i found jlayer is the easiest way to play mp3 audio,it plays well but can't stop playing my GUI stops responding until the audio is finished! any help please this is the code of the playing button -chooser …

Member Avatar for ringo_tech
0
1K
Member Avatar for ilovejava

[QUOTE=ilovejava;1755404][URL="http://i.imgur.com/iwNHY.jpg"]http://i.imgur.com/iwNHY.jpg[/URL] i already set a path for jdk and etc, it worked before but now it doesnt work the code works on ecclipse so the code is correct but i have to learn how to compile using command prompt check out this image i get this same error i do …

Member Avatar for NormR1
0
305
Member Avatar for konman795

[QUOTE=NormR1;1755503]I'm not sure what techniques you can use to parse the String: "1, 2, and 3." and find the numeric digits that are to be replaced with text without looping. switch statements are a way to "jump" to a block of code based on a value. Some think it a …

Member Avatar for konman795
0
356
Member Avatar for jakubee

[QUOTE=jakubee;1755483]Hello everyone, This is my first post in here :) Need a help with v. simple exercise. I need to ask user to input 10 objects of type Product (String name, Double price). I manage to done this. What i need to do now is to validate this inputs! I …

Member Avatar for DavidKroukamp
0
5K
Member Avatar for gowans07

unless doing mobile development, I've never seen the *.jad extension used in any java application native to windows, if you already have a class file and wondering how to make it a jar file(double click and it runs) check here:[url]http://docs.oracle.com/javase/tutorial/security/toolsign/step2.html[/url] and this:[url]http://docs.oracle.com/javase/tutorial/deployment/jar/[/url] and maybe here:[url]http://www.javacoffeebreak.com/faq/faq0028.html[/url]

Member Avatar for DavidKroukamp
0
99
Member Avatar for Sanna.1

[QUOTE=Sanna.1;1755108]hello how do you get three strings in to a boolean. Number 1 is greater than the number 2, which in turn is greater than third Number 1 is greater than one of the numbers 2 and 3, but not greater than both Number 1 is greater than at least …

Member Avatar for Ezzaral
0
125
Member Avatar for Syrne

[QUOTE=Syrne;1755355]Hello all, I've been fooling around with some code trying to teach myself somewhat about Linked Lists. I wrote this quick program that creates a random number in each node of a list and asks the user to guess the number. I have a quit choice that, when executed alone …

Member Avatar for DavidKroukamp
0
219
Member Avatar for kalcio

[QUOTE=kalcio;1754824]pleaze help me sir,i need to correct this code[/QUOTE] I hope maybe these might help:[url]http://stackoverflow.com/questions/7174420/change-colors-for-jprogressbar-with-nimbus[/url] , [url]http://docs.oracle.com/javase/7/docs/api/javax/swing/plaf/nimbus/package-summary.html[/url] and [url]http://stackoverflow.com/questions/3480125/setting-the-colors-of-a-jprogressbar-text[/url]

Member Avatar for kalcio
0
2K
Member Avatar for mohamed moamen

[QUOTE=mohamed moamen;1755078]of course yes :)[/QUOTE] I think i found the problem: [code] FileOutputStream fos = new FileOutputStream(entry.getName());[/code] this extratcs all the data to your jars current directory??? try this:[code] FileOutputStream fos = new FileOutputStream("c:\\"+entry.getName());[/code] btw your buffer should be static, and your missing ';' after zip name:[code]final int BUFFER....//change to …

Member Avatar for mohamed moamen
0
337

The End.