36,051 Topics
![]() | |
Is it possible to write to an existing text file in a jar. I managed to read from it with getResource() but I am stuck trying to write to it, it gives me a file not found exception. Thanks | |
I am working on a moving object. so I created a menu bar for size and speed, the idea behind it is that each time small, big or medium is clicked it should change the size and same also applies to the speed but when implement the action listener its … | |
[CODE] statsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ //Return the string "stats" to gameLoop() as cmd } }); [/CODE] [CODE] public void gameLoop(){ Scanner lineScanner = new Scanner(System.in); cmd = ""; System.out.print(getBoard().printBoard(false)); while (!cmd.equals("quit")) { System.out.print(">"); Scanner wordScanner = new Scanner(lineScanner.nextLine()); if (wordScanner.hasNext()) { cmd = wordScanner.next(); if (cmd.equals("board")) { … | |
I have posted one code. please help me i can't get msg at mouse pointer. please tell me how can i get label at the co-ordinates where the event has taken place. also tell what is the problem with code..it gives output after minimizing and maximizing. hope for reply. Thank … | |
Complete method called characterCount below so that it returns the number of times the character ch appears in the string s. [CODE] public int characterCount(String s, char ch) { } [/CODE] I know that I have to use a for loop and use s.length() as a stopping point. Other than … | |
this is a page of code on a Apache Tomcat server the error i get is the following : Eror :licenta\upload\Tulips.jpg (The system cannot find the path specified) project path is : ROOT\licenta [CODE]<%@ page import="java.io.*" %> <%@ page import="java.lang.*" %> <%@ page import="java.sql.*" %> <%@ page import="java.util.*" %> <%@ … | |
I am a begining software engineer in college and have been stumped by a small problem. The assignment is to "encrypt" any text entered. All we have to do is make capitals lower case and vice versa, additionally we have to make a's z's, b's y's and so on. //import … ![]() | |
Hi all, I have a main GUI class as seen here: [CODE] import java.awt.*; import javax.swing.*; import javax.swing.border.*; /* * Class is to communicate with various other classes in the program to * create a roster for user based on their selection on GUI. */ public class MainGUI extends JFrame … | |
how to write the math function f(x) with Java where f(x) = y ![]() | |
hi could anyone tell me how to get bit pattern of a negetive number. For example bit pattern of -1357 is: 11111111111111111111101010110011 and bit pattern of 1357 is: 00000000000000000000010101001101 but how???? | |
Hi, I'm making an app that uses Collections. Everything went ok until now, what I've done: I've got a class that initializes 3 strings, those strings are private, so I have made 6 public functions that sets or reads values from those strings. Next I've made a hashmap, keys are … | |
I am trying to publish my ear and war modules into Oracle weblogic portal 10.3.0.0 server using workshop. I am using pointbase DB. But publishing failed since I was getting the following error, weblogic.application.ModuleException: Exception preparing module: EJBModule(netuix.jar)Unable to deploy EJB: ProxyPagePersistenceManager from netuix.jar: Exception while attempting to deploy Security … | |
Guys,i want a small help from you.I have a created a database in MS Access and now i want to connect it to with Java Application by using ODBC Administartor.But when opens it,it doesn't show any driver for MS Access DBs.Do u guys know any driver for that.I'm using Windows … | |
Hi Everyone, I'm new here and also new in using Java. I want to make an iterator without using the default methods hasNext, hasPrevious. Here is what I've already done using the default methods: [CODE]import java.util.*; public class HomeIterator{ public static void main(String[] args) { int i = 0; ArrayList … | |
hi, please help me debug this, i am trying to add one row from one table to another at the same delete it from the table i am getting it from. (cut and paste kinda thing). Only one part works, i can only copy and not delete. [CODE] int recordAffected … | |
Hi all, If I write a java program inside of eclipse, how can I run that program outside of it, rather than just hitting the run button in eclipse. So, I can give others the program to run on their computers. Thanks! | |
Hi everyone, I'm working on a project for my computer science class and we're supposed to make a java applet game. I'm not very far in the game quite yet, but I'm trying to make sure that the mouseListener and the rectangles work before I continue on with the game. … | |
Hi everyone, i'm trying to make a sound each time a ball touches the lift and right of a frame but when i use clip and try to use the sound class it sound from right then left the in middle and then stop. i Can really use some help. … | |
Hi All, I am currently trying to figure out to finish this project. Below is my code that I have so far. There are some blank methods that I am not sure where to even begin on how to complete them. I have a description of what the methods should … | |
I was working on some code to produce a 10 x 10 multiplication table with equal tabbing and spacing between rows. I can't seem to get more than one column on my table though. I did some other research but wasn't able to find a helpful answer. Any help is … | |
Is it possible to get a user's mac address when he visits my website through a JApplet? | |
I have got everything right and my project is compiling. But I am experiencing problem with servlets, when I right click on a servlet and click on run in netbeans then I get following two error: 1) Class "Servlet1" neither has a main method not it a servlet specified in … | |
I have to write a program that takes the smallest number from a list of numbers and puts it on the first position. [CODE]public static void minToFront (ArrayList<Integer> minInteger) { int result = 0; int min = minInteger.get(0); for (int i = 0; i < minInteger.size(); i++) { if (minInteger.get(i)< … | |
Hi, I'm trying to write a program in Java to send AT commands to my mobile and recive information via BlueT from it. I've already got a program to search and fide blueT Devices, and thats how i receve: 1.name of device 2.blueTooth Adress How to use this two things … | |
hello all when I do javac ,I often warn to use -Xlint ,and then the result has one or more warning. As example I attach the javac's result below.The question is how to eliminate warning thank you denny C:\LJava>javac -Xlint -d build src\KwitansiJava04.java warning: [path] bad path element "%classpath%": no … | |
This is saying that the sum is 0.0 but I am not sure if it is right. Can someone let me know please. Here is the code i used: [CODE]import java.util.Scanner; public class Lab424 { public static void main(String[] args) { int i; float sum; i=3; sum=0; while(i<=99) { sum=sum … | |
hi Is this possible to send a request to servlet from socket client? I use request.getInputStream method to get client request. I got an error HTTP/1.1 400 Bad Request Server:Apache-Coyoyte/1.1 Transfer Encoding:chunked Date:Fri,04 Nov 2011 Connection:close How can I achieve my task?? | |
I am creating a simple GUI with a few buttons and a text field. I set the window size to to 500x500 and the text field fits on the South perfectly but once i resize the window the text field stays the same size is it possible to make to … | |
Hi all in code below ,after I got the object aobj ,how can I identify which component aobj actualy is.And where is it Location ? thank you denny [CODE]CaretListener listener = new CaretListener() { public void caretUpdate(CaretEvent caretEvent) { Object aobj=caretEvent.getSource(); Component comp=aobj. System.out.println(aobj.toString()); } };[/CODE] | |
Hi guys, I'm taking a Networking & Internet Systems module... have little experience working with java and am trying to work through an assignment... hopefully you can help! The task is to implement a basic UDP chat system. Create a simple chat system which uses the network (at least locally) … | |
SO ive searched the web for a tutorial on a simple ftp server and client made in Java and have only been able to find ones that show you how to make a ftp client for apache , however i want to make a ftp server in Java as well … | |
I'm trying to make it print out like this ***** **** *** ** * but it keeps on coming out like this: ***** **** *** ** ** here is the code i used [CODE]public class Asterisk { public static void main(String[] args) { for (int i=5; i>0;i--) { System.out.println(""); for … | |
I have a program to write an application that takes the initial balance, annual rate, and number of years and finds the balance of the account at the end of each year. I have the following code but my Annual Rate label is in the incorrect place, the calculate button … | |
I have made a media player in java using jmf which plays mp3,midi,mpeg1,mpeg2&avi. How to play the [COLOR="green"]mpeg4[/COLOR].Also i want to make a [COLOR="Green"]playlist[/COLOR] for it which can add,delete and save the songs in the playlist.here is my code of media player..... [code]import javax.media.*; import java.awt.*; import java.awt.event.*; class MediaPlayer … | |
Write the ideal weight calculator so that height in inches is entered by using a slider. Use the approximate formula: W = H2 / 30 , for female W = H2 / 28 , for male where W is the ideal weight in pounds, H is the height in inches … ![]() | |
#1 - I'm a newb to java :( #2 Im having a problem getting getting my JTable to update when the user edits a cell. Im using a abstract model which is basically what the sun tutorial did word for word( i used a abstractmodel so i could make columns … | |
Hi members, just a simple question, how would I show a constant in an UML diagram? For example, here is a double field the class contains. - radius : double But how would the constant PI (3.14159...) be shown? - PI : constant?? Future thanks for the responses! | |
how to lookup datasource which is created in glassfish with some jndi/dbname name. I am trying to get datasource writing code in a servlet like this Datasource datasource = (Datasource)initialContext.lookup("jdbc/customer"); Connection con = datasource.getConnection(); but it is throwing NameNotFoudExcepion for this context . how can access datasource created outside of … | |
Hello :) Lets say I have a text file that looks like this : [CODE]*DataString1 info1;info2;info3 //newline delimiter *DataString2 info1;info2;info3;info4 //newline delimiter . . . //and so on [/CODE] What is the best container with which I could process and manipulate the information stored in this file? Thank you for … | |
i've created a project .....in which on executing the h.java the second window3.java appears slowly as you can see that by running the below source code.............but the problem is that the second form i.e window3.java on displaying does'nt shows the noire look and feel environment as well as no noire … | |
Hi i am new to tomcat can any one of you explain how to deploy application in tomcat using server.xml with description | |
So i made a face using several ovals, a arc, and a polyline in the graphics class. I want to be able to change the size of the face based on the number input into the JTextField. Right now the value for the textfield is the variable "size" in the … | |
//This program will prompt for user to enter in the Fahrenheit temperature and convert it to Celsius. import java.util.Scanner; public class Project4 { public static void main (String[]args) { double temperature; double celsius; Scanner scan = new Scanner (System.in); System.out.println("Enter the current temperature in Fahrenheit: "); temperature = scan.nextDouble(); celsius … | |
I have the following program written where Square extends Rectangle. I cannot figure out how to get the correct display for the x and y coordinates. It should display Expected: Square[x=5, y=5, width=30, height=30] but instead it displays Square[x=10,y=20,width=30,height=30]. [code] import java.awt.Rectangle; public class Square extends Rectangle { private int … | |
public class SimplifiedMath { public double max (double first, double second) { if ( 58 > 100) { return first; } else { return second; } } public double min (double first, double second) { if (35 < 13) { return first; } else { return second; } } public … | |
the program runs but fails to read the double word states (e.g New Jersey). am getting the error.java.lang.NumberFormatException: For input string: "Hampshire" [CODE] import java.text.DecimalFormat; import java.util.*; import java.io.*; import java.lang.reflect.Array; import java.nio.CharBuffer; import java.awt.*; //import java.awt.event.*; import javax.lang.model.type.ArrayType; import javax.swing.*; import javax.swing.event.*; public class PJ5 extends JFrame implements ListSelectionListener … ![]() | |
Hello everyone, I think I need a second eye on the code. I'm not sure where I went wrong but it was working at some point. Everything should run without a problem any idea what is going on? A second opinion would be highly appreciated... [ICODE]import java.util.Calender; import java.util.GregorianCalendar; public … | |
hey guys I need help to implement a array list I have the skeleton structure written out but some of the methods do not work and I have troubles with the remove method please help and how do you do isEmpy method [CODE]//tried my best dont get some stuff public … | |
Help with java Button How about I'm making a music player but I like the look of the button you added the image as ImageIcon because for example the play button is round and I want to lose those edges rectangular button and wanted to find a way to insert … | |
Hello, I would like to use a button as a link and pass the session variable in a jsp! The below code should work. Any help is appreciated. Thanks. I use encodeURL if the user has cookies off. This works with links but not when using an input button with … |
The End.