398 Posted Topics
Re: [QUOTE=gedas;1750010]hey guys, i need to create an application which would allow me to log on to ssh server and would allow me to use linux commands in the application, not necessarily all commands, but the main ones such as cd, ls, grep. please let me know where i can start … | |
Re: [QUOTE=Skeldave;1749895]I'm still having problems. I have found that it works with a JButton but not my TileButton. I don't understand why this is happening as I inherrit the JButton class. I tried it with a null layout and setting the bounds manually and this seems to work, but it doesn't … | |
Re: [QUOTE=harinath_2007;1748305]Hi folks. I have a java application which plays a audio file . SO before the audio file or sound is played by my java application , i want to mute all other application sounds like Windows media player , VLC player (etc) if those are currently playing at that … | |
Re: [QUOTE=rushikesh jadha;1749958]please explain me the life cycle of servlt.[/QUOTE] uhm try this first hey its not hard:[url]http://www.google.co.za/search?aq=0&oq=servlet+life&sourceid=chrome&ie=UTF-8&q=servlet+life+cycle[/url] | |
Re: [QUOTE=rushikesh jadha;1749935]Plase tell me how to use system tray icon and toolbar in java.[/QUOTE] check these links:[url]http://blogs.oracle.com/CoreJavaTechTips/entry/getting_to_know_system_tray[/url] , [url]http://docs.oracle.com/javase/7/docs/api/java/awt/SystemTray.html[/url] , [url]http://docs.oracle.com/javase/tutorial/uiswing/misc/systemtray.html[/url] | |
Re: [QUOTE=rushikesh jadha;1749918]Thankx for reply It does not throw any exception only it does not display image.[/QUOTE] Normall you would do this to make sure the image is loaded:[code] ImageIcon ii=new ImageIcon("bank.jpg"); ... if(ii==null){ System.out.println("Image not loaded/found"); //now atleast you'll know if its a problem with the location of the image … | |
Re: [QUOTE=rushikesh jadha;1749923]Please give me one example of that.[/QUOTE] check here:[url]http://docs.oracle.com/javase/tutorial/uiswing/events/focuslistener.html[/url] and this:[url]http://www.javadocexamples.com/java_source/org/swixat/commands/WindowFocusEvents.java.html[/url] | |
Re: [QUOTE=laklaker;1747332]:| Still having a problem.[/QUOTE] Even a Google on reading and writing to text files should help you hey.... start your code from the beginning because its just confusing you more. Think of it logically, first you would read the file, get the data you want do what's needed to … | |
Re: [QUOTE=thepythonguy;1749716]I hope you can download![/QUOTE] the best explanation and reason for using inner classes/static inner classes is in the docs zeroliken gave you: A nested class is a member of its enclosing class. Non-static nested classes (inner classes) have access to other members of the enclosing class, even if they … | |
Re: [QUOTE=jmace;1748740]When I try to output an ASCII value to a file, it sometimes writes the wrong value. Example: [CODE] import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.PrintWriter; public class test { public static void main(String args[]){ //Supposed to: writeFile("./test.txt"); //write ASCII 147 readFile("./test.txt"); //read ASCII 147 } public … | |
Re: [QUOTE=ghada ali;1748729]I have a code for speech recognition but it not work good it has a problem in line 31 what is the solution ??? [code] import edu.cmu.sphinx.frontend.util.Microphone; import edu.cmu.sphinx.recognizer.Recognizer; import edu.cmu.sphinx.result.Result; import edu.cmu.sphinx.util.props.ConfigurationManager; import edu.cmu.sphinx.util.props.PropertyException; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Level; import java.util.logging.Logger; public class … | |
Re: [QUOTE=Goldfinch;1748951]Hi, I'm trying to understand a java concept, I'm trying to get a piece of code to work without changing the main method. [CODE=java] public class TestProg2{ public static void main(String args[]){ String filler1="Rank"; String filler2="Suit"; Card card = new Card(); System.out.println(card); } } class Card{ public String Card(){ String … | |
Re: [QUOTE=MBPB;1748680]Thanks for the response. I'm not sure if I should be using both of those loops, though. It is executing with no compiler errors, but the problem now is that it is inserting "0" into all the fields including and after the sentinel is entered. (I use another method later … | |
Re: [QUOTE=scheppy;1748725]Ok, so I have my code for the timer [CODE] computer = new Timer (4000, this); computer.start (); [/CODE] The timer starts at the end of a method, and is supposed to start another method via actionlistener after 4 seconds, the problem is, after 4 seconds, the timer gives a … | |
Re: [QUOTE=miss_lovely;1748723]Write a class that accepts a user's hourly rate of pay and number of hours worked. Display the user's gross pay, the withholding tax (15% of gross pay) and the net pay, (gross pay - withholding) I have my code below, but I'm lost. I dont know what I'm doing … | |
Re: [QUOTE=scheppy;1747576]ok so I have a JButton that has an image on it, and then after 4 seconds i want to put a differant image on it but the problem is the first image wont load I'm using [CODE] button1.setIcon (icon); try { Thread.sleep (4000); //sleeping for 4 seconds } catch … | |
Re: [QUOTE=brandon66;1748642]I get the same output value each time i run the application. I get 3628800; s the factorial of numbers 1-10. Step1: use while loop to see if the user wants to contiunue Step2: Ask user for integer Step3: Use the for loop to calculate the factorials Step4:Use the if … | |
Re: [QUOTE=raj.mscking;1748287]Hi Gentles! My Self Raj, I am a new user of this site, i wants to create an application (with concept of Ecryption & Decryption) for transfer image with hiding (media file eg.mp3) Any one can help me how can do it, and how much possibilities combine hided media with … | |
Re: [QUOTE=gedas;1748436]hey guys, i am trying to create an app that would review text file that is on the server, how would i go around in doing that? i believe i need to login to the server for example root@123.123.123.123 and eneter the password, later i need to navigate the file … | |
![]() | Re: [QUOTE=mehnihma;1748134]in description I just have this: Modify your solution from Part 1 to implement the action listener for the Reset button in a separate class name ResetListener[/QUOTE] what are the problems you are having this code looks fine to me, just you would need to add the action listener to … |
Re: [QUOTE=harinath_2007;1747468]Hi , I developed an application which checks mail(gmail) all the time and alerts me whenever new mail has come. In short its a email notifier or email alerter. The application uses IMAP protocol .The application opens the connection once and it continously checks whether a new mail has come. … | |
Re: [QUOTE=furqanishaq;1748240]hiya i stuck on this can anyone help please Result1 = (Val1*Val2)/Val3; Result2 = (Val1+Val2)-Val3; write a sperate method to print the result of the above calculation and then write a main app class to create an operator object set it up with some test data to calculate the values … | |
Re: [QUOTE=thepythonguy;1744896]Sorry, but I still didn't get it.[/QUOTE] Check here the java docs help me understand even the most complex of definitions:[url]http://docs.oracle.com/javase/tutorial/java/IandI/abstract.html[/url] another good def:[url]http://www.roseindia.net/help/java/a/abstract-keyword.shtml[/url] | |
Re: [QUOTE=letters1417;1747824]I have this: [CODE]for (int i = 1; i < n; i +=2) { for (int j = 0; j < n-1-i / 2; j++) System.out.print(" "); for (int j = 0; j < i; j++) System.out.print("*"); System.out.print("\n"); } for (int i = n-2; i > 0; i -= 2) … | |
Re: [QUOTE=bsabowala;1747639]When I export the program to a executive Jar, file.txt does not import. The file.txt is in my src folder. Everything works file when i run the program in eclipse but when i export it, it does not import. HELP, I am new to Java and everything.[/QUOTE] because it is … | |
Re: [QUOTE=FALL3N;1746781]But this does not work either... [CODE]String[] text = word.split("\$");[/CODE] should I declare the "\$" as part of a Pattern? Or a Matcher? or use ' instead of "? I know this started out ridiculous, and just keeps getting more ridiculous, but I am really getting thrown by this.[/QUOTE] [EDIT] … | |
Re: [QUOTE=ThaiAmL;1747674]I'm writing an assignment for my introduction to programming class and we're supposed to implement the following interface: [CODE] public Interface Account{ //Calculates interest (1%) and adds to the account balance public void interest(); //Calculates the balance after a deposit public void payIn(double money); //Calculates the balance after a charge … | |
Re: [QUOTE=Thermalnuke;1747653]im entering .065 which should be 6.5% but it is displaying 7% even[/QUOTE] check this DecimalFormat class which will hopefully make the other digits after the dot show:[url]http://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html[/url] and this:[url]http://www.exampledepot.com/egs/java.text/FormatNum.html[/url] but i do agree with stultuske just multiply by 100 and you'll have the percentage rather then using a whole … | |
Re: [QUOTE=ThaiAmL;1747593]Thank you for the answers to 1 and 2 - for the third question, I'm a bit confused. We're not supposed to have a set value for the transfer amount, so where you wrote "double var = ... " - I don't have any value to assign there. In the … | |
Re: [QUOTE=scheppy;1747555]Is there a method to check if a JButton has an Icon? becouse I've been searching all over google and i cant seem to find anything[/QUOTE] how about using[code] jButton1.getIcon(); [/code] it usually returns null if no icon is attached. | |
Re: [QUOTE=Vampiricx3;1747410]What do you mean by that? What I had in mind was a scanner reading it from my .txt file, and then adding to an ArrayList, then printing out within the JComboBox, but I'm not sure how it would all fall together.[/QUOTE] check these links for help maybe:[url]http://java.sun.com/developer/onlineTraining/collections/magercises/ComboBox/index.html[/url] and :[url]http://www.dreamincode.net/forums/topic/166333-how-do-i-populate-jcombobox-with-arraylist/[/url] … | |
![]() | Re: [QUOTE=mehnihma;1746775]I have problem with do while loop I need something like this [CODE] What do you want to do? 1 Create a new account 2 Deposite funds 3 Withdraw funds 4 Show Balance 5 Show Interest 6 Show Summary 7 Quit Enter Option: 2 Which account <1 to 2> do … ![]() |
Re: [QUOTE=ThaiAmL;1746750]I'm working on a program for an intro to java class and am supposed to use the following interface: [CODE]public Interface Animal{ //The animal is first supposed to "speak" and then it gets to eat //As long as the food supply lasts public void feed(); //The animal eats public void … | |
Re: [QUOTE=shotokanpoloto;1745832]Hi! My project has two text file:input and output java.util.NoSuchElementException: No line foundread exception Exception in thread "main" java.lang.NullPointerException at java.io.Writer.write(Writer.java:140) at nfa2dfa.NfaToDfa.OutputFile(NfaToDfa.java:217) at nfa2dfa.Main.main(Main.java:30) I don't know what they mean?![/QUOTE] as for as i can see it says you are trying to write a null value to the textfile, … | |
Re: [QUOTE=samidha;1746252]Hi, in my java project Employee Payroll, I am supposed to include a Ideal-Time window and maintain log for that ideal time for particular Employee... On the basis of which salary deduction or bonus to the employee will be calculated... For maintaining log, we will need JDBC; but for creating … | |
Re: [QUOTE=drico7041;1745030]Hey, I was having trouble making my vector print out randomly generated numbers in ascending order. Can I please get some help?. This is my assignment "Write a program name count.java that will use a Vector to store 10,000 randomly generated numbers (ranging from 1 to 99) Now sort the … | |
Re: [QUOTE=Shodow;1745706]example i will enter timein: 1:30 timeout: 5:00 how to know their time difference?in timeformat or how to accept a timeformat input from the user[/QUOTE] check out here, can use an external API or the one you're trying:[url]http://stackoverflow.com/questions/6690929/convert-string-to-time-and-calculate-difference[/url] | |
Re: [QUOTE=shotokanpoloto;1745409]I want to run an exe file in my project. I mean when I run my codes,a specific executable file run. How can I do that?[/QUOTE] you could also look at using a Runtime class of java:[code]import java.io.*; public class TestExec { public static void main(String[] args) { try { … | |
Re: [QUOTE=laklaker;1744708]I created a game a random guessing game ( for school project ) . I just want to ask on how to put a hall of fame? Like when you played the game then its end it will be putted his/her name then it will be saved. Then it will … | |
Re: [QUOTE=jpsider;1744083]when I place that in the code I get an error that it cannot find the class DecimalFormat.[/QUOTE] try importing [code] import java.text.DecimalFormat;[/code] | |
Re: [QUOTE=javalover;1744214]Sir, I need a java program (ie), if we mark a part of an image, the portion with same intensity in that image should also be segmented and saved separately .. Thanks in advance..[/QUOTE] so have you got any code to show? if not id start coding then hey lol, … ![]() | |
Re: [QUOTE=enterpise;1744962]now i'm writing a method which is checking the ip already exist or not [CODE]private boolean EXISTIP(String s) { boolean result = true; try{ for (int i = 0; i < Client_list.length; i++) { if (Client_list[i][0].equals(s)) { return true; } else { result = false; } } }catch(Exception e){ return … | |
Re: [QUOTE=anhtho3008;1744915]So here is my assignment: Write a java program to read a name from user . The name is typed all in one line. The name may include 3 or 2 or 1 part from: firstname middlename lastname You should create an email id from the name and print it. … | |
Re: [QUOTE=pseudorandom21;1744587]Java: I have a bunch of stuff drawn to the blank space of a JApplet app. I need to add a JButton at a specific location. I don't know how. What's the easiest way to do this?[/QUOTE] hmm take a look here, it just adds on to what NormR1 said:[url]http://stackoverflow.com/questions/3195666/how-to-place-a-jbutton-at-a-desired-location-in-a-jframe-using-java[/url] | |
Re: [QUOTE=justin6345704;1744335]Hi everyone. First time poster, brand new to java but I like it. I'm comfortable with the very basics but as we move forward I'm starting to struggle. My prof is not very good about explaining things so I've been teaching it to myself mostly. My most recent assignment involves … | |
Re: [QUOTE=Mr.BunyRabit;1744612]Hey there. At the moment to close a form (like to go back to a previous form) i use this.hide(); But ive read things that some statements "Dont realy close the form, and it still runs or whatever" Is this the rigt way to close one of my forms? And … | |
Re: [QUOTE=EulavValue;1744289]Hello, I am pretty new to programming and needed some help with one of my programs. I am trying to have the user input how many numbers they want to plug in then they plug in x amount of numbers until they reach whatever they input. After that I am … | |
Re: [QUOTE=sha11e;1744236]1. So is what I heard wrong? About the space for the variables being 'reserved' throughout the whole program? 2. Should I or should I not declare all my variables directly (under main method declaration) or declare and initiate as I need them?[/QUOTE] To be honest in java it doesnt … | |
Re: [QUOTE=xzero1;1743990]Hi all, I am a beginner in Java, making GUI in blueJ. I want to use CheckBoxList for multiple selection from a list for users.. I just want to learn how to make one of that. I saw some codes here .They use some sort of CheckListRenderer. I am also … | |
Re: [QUOTE=nilay84;1744175]Anyone knows how to only allow characters in a JtextField not strings or digits? any example source code will be appreciated.[/QUOTE] see this:[url]http://www.daniweb.com/software-development/java/threads/73050[/url] what you should get from this is there is only two ways, either wait until all text has been entered and then check to make sure that … |
The End.