2,777 Posted Topics
Re: [QUOTE] How do I go about displaying all the lines from the file in one output box?[/QUOTE] Concatenate the lines together separated by new line characters (\n) | |
Re: If the data is in a file, you can use the Scanner class to read the contents of the file into Strings using one of its next....() methods. | |
Re: [QUOTE]the circlearea Jlabel wont update.[/QUOTE] The only variable I find with that name is: [CODE] static double circlearea;[/CODE] Can you say what JLabel you are talking about? [QUOTE] I get an error[/QUOTE] Please post the full text of the error message. | |
Re: Have you tried using Search on this forum (or with Google) to find code samples. | |
Re: Are there any error messages in the browser's java console? | |
Re: Java is does not know much about the internals of most OSs. You will need another tool that can talk to Windows' internals. | |
Re: Can you put the image into the jar file and save loading it from the server? Look at using ImageIO and the Class class's getResource() method [QUOTE]a way to only paint that object in the location you want it[/QUOTE] Not sure what you are asking here. By object do you … | |
Re: To save for a long time probably means you have to write the data to a disk file or a database. See this site for some info: [url]http://docs.oracle.com/javase/tutorial/essential/io/index.html[/url] | |
Re: Create a BufferedImage object and set its pixels as per the array. | |
Re: [QUOTE]The problem is that after a certain amount of characters, everything is being writting to the next line[/QUOTE] How do you define a line. Normal definition is a line contains all the characters up to the line end character ('\n'). A very large file can contain no line end chars … | |
Re: It looks like you're mixing enum and generics: "has three states" Can you explain what you are trying to do? | |
Re: [QUOTE]which inteface should I use to import the image from the file[/QUOTE] The ImageIO class has methods for reading images from a disk file. [QUOTE]show the image in the dailog[/QUOTE] You could make the image an icon in a JLabel. The ImageIcon class also has ways to get its image … | |
Re: [QUOTE]edit the same files at the same time without conflict[/QUOTE] That sounds like VERY sophisticated software. | |
Re: Can you explain your problem? If the shapesList array has all the shapes you want to draw, could the paint method loop through the array and draw the shapes saved there? | |
Re: [QUOTE]I have some problems to complete this task.[/QUOTE] Please post your questions and problems. | |
Re: [QUOTE]In my JApplet, my actionPerformed method should open a website [/QUOTE] Have you looked at the showDocument method? applets are restricted in what they can do. [url]http://docs.oracle.com/javase/tutorial/deployment/applet/security.html[/url] | |
Re: [QUOTE]what I need help with. Writing the method calcStDev. [/QUOTE] Do you have the formula for calculating the std dev given a list of numbers? You will need that before you can write any code. | |
Re: Cross posted at [url]http://www.java-forums.org/new-java/53203-cipher-system.html[/url] | |
Re: [QUOTE]its give me wrong output[/QUOTE] Can you post the output and add some comments to the output saying what is wrong with the output and show what the output should be? The more you explain, the better we will be able to help. | |
Re: [QUOTE]ve gotten this to work with a for loop without a sentinel value[/QUOTE] How did you stop the loop? What do you understand a sentinel value to mean? If you can write a loop to get input from a user, what ways do you have to have the user tell … | |
Re: [QUOTE]it wont work.[/QUOTE] Please explain. Do you get errors? Please post the full text of the error message. Do the listener methods get called? Does the component with the listeners have the focus? Can the component with the listeners receive the focus? Not all components do this automatically, you need … | |
Re: The trick with making a batch file to execute a single java class file is to use the right variable name in the batch file that picks up only the file name. I think it is something like: %~n1 This would allow you to set the RightClick context menu to … | |
| |
Re: Where is the class: AOperation defined? Is its location on the classpath for the javac command? | |
Re: [QUOTE]what is the use of "move" method here?[/QUOTE] Here you need to use the API doc. It will explain to you what the move method does. Find the object class that move is a method for and go to that class's API doc. | |
Re: Or would overloading methods do it. | |
Re: You use classes to build a java application. The window would be a JFrame. The rest is up to your design. You should take the time to read the Java tutorials and learn something about java before trying to write an app. Some links: [url]http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/[/url] [url]http://download.oracle.com/javase/tutorial/reallybigindex.html[/url] | |
Re: See response to this question on the other forum where you posted it. | |
Re: Look at the showDocument method. | |
Re: Do you have an algorithm you are trying to use? Can you write a list of pseudo code statements to describe it? | |
Re: In case you are having trouble with google: [url]http://docs.oracle.com/javase/tutorial/uiswing/events/index.html[/url] | |
Re: [QUOTE] the lest for statement its not print array in reverse order [/QUOTE] Please post the program's output that shows the problem. You need to edit your code and properly align the statements. The messy way you have posted the code makes it very hard to read. You should align … | |
Re: Please explain what your problem is? [QUOTE] check if a given number is plindrom or not [/QUOTE] What is the code supposed to be doing with all the numbers it reads in? | |
Re: So you can show us what is happening (on Windows) To copy the contents of the command prompt window: Click on Icon in upper left corner Select Edit Select 'Select All' - The selection will show Click in upper left again Select Edit and click 'Copy' Paste here. | |
Re: Can you make a small simple program (SSCCE) that shows your problem? You've posted too much code for most people to want to work with. | |
Re: Please post any code you have that you want us to look at here on the forum. | |
Re: Do you have an algorithm that describes your logic in finding the two largest elements? A list of the steps you think will solve the problem. | |
Re: Please make a small simple complete program (SSCCE) that shows your problem and post it here. | |
Re: If you want your code to wait for user response, try using a modal dialog instead of a JFrame for the Login class. | |
Re: It's possible on Windows to have several different versions of java available. One is the default, the others I get to by using full paths to the javac.exe or java.exe commands. | |
Re: It is possible to add the same action listener as a listener for more than one button. Create an inner class that implements the ActionListener interface, create an instance of it and add it as listener to the buttons. | |
Re: [QUOTE]identify which button in the array[/QUOTE] In the listener you can call the Event class's getSource method to get a reference to the component causing the event. To save information about a component/button (like where you put it in an array) you could use the JComponent's ClientProperties which is like … | |
Re: Is this a java syntax problem or does it have to do with the way the package you are using works? You can create an array anywhere in your code and then pass a reference to that array to a method as its argument. You do not need to create … | |
Re: On windows you can create a shortcut to the .jar file and copy that to your desktop. | |
Re: What is the value of timeDifference and what displays for the formatted date? | |
Re: What variable has a null value? Where does that variable get assigned a value? Add a println next to where the variable gets a value to see if that code is being executed. If there is no print out, then the code is not executed and p will not get … | |
Re: [QUOTE]java.lang.NullPointerException at java.applet.Applet.getDocumentBase(Applet.java:141) at Deck.<init>(Deck.java:38) //line 6 first block [/QUOTE] What is the statement at line 38 doing? If your code is not an applet running in a browser, there is no AppletContext object that can be called to get the document base. |
The End.