35,619 Topics

Member Avatar for
Member Avatar for rayden150

I cant seem to save these data correctly I have mainly doubles and strings, I am saving these in a .txt file called "autosAudi.txt", I get these weird codes and boxes and sometimes for whatever reason Chinese in my textfields? Here is a example of what appears: [url]http://www.flickr.com/photos/63259070@N06/6449175293[/url] as you …

Member Avatar for hfx642
0
223
Member Avatar for David321

I'm supposed to be making an inventory program with a logo. I can get the inventory part working fine in a jframe, and I can get the logo working fine in jpanel, but if I combine them it starts acting really weird. Every time I click a button, it generates …

Member Avatar for JamesCherrill
0
202
Member Avatar for Unsated

Hi everyone i have this simple banking program here and i was hoping someone could help me jazz it up.. Something simple like making it easier to use or making it look better. Just trying to go beyond what was asked for.. [CODE] import javax.swing.JOptionPane; class MiniLab5z { public static …

Member Avatar for JamesCherrill
0
168
Member Avatar for oldezwe

I do not know how to do this and can not find how on google. I want to add code to my action listener to disable a jButton after it is clicked an then enable it again after x amount of time. anyone know how to do this?

Member Avatar for JamesCherrill
0
239
Member Avatar for persianprez

So here is what I'm trying to do: I have a file with a list of ip addresses eg.(123.45.6.789:80) I have two arrays; ip and port, what I want to do is break the address and place the parts into the arrays. so 123.45.6.789 would go into the ip array …

Member Avatar for JamesCherrill
0
125
Member Avatar for Joey_Brown

Hello; Is there a way in java to create a flip card effect. I have two pictures, that are to form a double sided card. Ive come with a way to snapshot them in different angles and finally iterate through them in a loop. Its not very good :) Is …

Member Avatar for hiddepolen
0
111
Member Avatar for efronefron

Server Code [CODE]import java.io.DataInputStream; import java.io.DataOutputStream; import java.net.ServerSocket; import java.net.Socket; /** * * @author efron */ public class Server { public static void main(String[] args) { try { ServerSocket serverSocket = new ServerSocket(Integer.parseInt("49999")); System.out.println(serverSocket.getLocalPort()); while (true) { System.out.println("Waiting for Client...(port = " + 49999 + ")"); Socket acceptSocket = serverSocket.accept(); …

Member Avatar for ~s.o.s~
0
1K
Member Avatar for pbracing33b

Hello Dani-Web participants, I have an problem, I currently have simulation that runs fine in console, and now our teacher wants us to put it into a GUI type format. The problem that I am having is that the cancel button and close (X) button does not work what so …

Member Avatar for mKorbel
0
2K
Member Avatar for km2011

Dear all sir, i'm a begining of java and i have a problem to write the equation in java code , i want to make it in for loop and i also want to count it by column.how do i do? please me!!! example: f[1][1]=5.4; f[2][1]=5.0; f[3][1]=1.5; k[1][1]=|f[1][1]-f[2][1]|+|f[1][1]-f[3][1]-|; k[2][1]=|f[2][1]-f[1][1]|+|f[2][1]-f[3][1]-|; k[3][1]=|f[3][1]-f[1][1]|+|f[3][1]-f[2][1]-|;

Member Avatar for hiddepolen
0
187
Member Avatar for hadeelh30

Hi can you help me please to Write a java class which prompts the user for an hourly rate (a double). The program should then calculate the wages for a 40 hour week using a while loop to count the hours and adding the hourly rate each time to the …

Member Avatar for pro_learner
-2
72
Member Avatar for oldezwe

i am using java, how do i get the database to tell me how many elements are in it and save that as an integer

Member Avatar for techsheaven
0
68
Member Avatar for mhariharasudan

Hi, I am a new Java Programmer.could you help me in resolving this. I am trying to created a JPanel withing a main JPanel. For the nested one, i have included Grid Layout and i am trying to add components to it dynamically. i.e i have added a combo box …

Member Avatar for mhariharasudan
0
1K
Member Avatar for jackmaverick1

Before you read this, please don't say how I could make this better, I've thought of it, or because of the circumstances, it's not possible. I'm having a problem where when I input a command into the Runtime class's exec function, it doesn't run. When I try the exact same …

Member Avatar for NormR1
0
295
Member Avatar for umsungun

import javax.swing.*; class ch9reverse{ public static void main (String [] args){ int Character, count = 0; char letter; String Str; Str = "The gate to Java nirvana is near"; [COLOR="Green"]For this must print out the "ehT etag ot avaJ anavrin si raen[/COLOR] Character = Str.length(); System.out.print(reverseString(Str));

Member Avatar for zeroliken
0
94
Member Avatar for Prisms

Hey guys I have this code snippet and I want to read from this file and print the contents of my text file (Transcript.txt) to the screen. I don't have any errors but when I run the program it prints "Display it to the standard output" instead of whats on …

Member Avatar for NormR1
0
242
Member Avatar for hfx642

[B][I]This it only for people who are running a DUAL Monitor system.[/I][/B] I wrote a sample program to display what occurs. No matter which button I click on (Primary Display OR Secondary Display), the JOptionPane will pop up on the Primary Display. What I would like to happen is... If …

Member Avatar for hfx642
0
961
Member Avatar for Danielhuo

I am writing a program that has a few requirements. Here is what it looks like the picture that I attached. [B][COLOR="red"]The first button is used to add (append) a record to a text file containing MP3 records.[/COLOR][/B] When an MP3 is added to the file, all text fields should …

Member Avatar for NormR1
0
873
Member Avatar for ilovejava

my objective is to implement an Java to HTML syntax highlighter. The program should works like this 1) It reads in any .java source code file 2) It parses the file for keywords, strings, numbers, etc. 3) It outputs HTML markup of the source code 4) When you open the …

Member Avatar for ilovejava
0
231
Member Avatar for sleepybug

I'm trying to do some socket programming in java. what i have is, i've written this program to create a server and client on my local machine and make separate two threads for socket input and out put in [B]Se.java[/B] file. Similarly two separate threads for socket input and output …

Member Avatar for JamesCherrill
0
1K
Member Avatar for asif49

I have to complete a project about employees and their jobs. The requirements include: Setting multiple jobs for an employee etc. etc. Two of the obvious classes I have for this are the Employee and Job class which hold individual employees and work like this: [CODE] private Employee[] e = …

Member Avatar for JamesCherrill
0
301
Member Avatar for nickliutw

I'm currently working on a program which is pig Latin. It allows a user enter a sentence. The program would take the user input and change every word in to pig latin which it takes the first character of a word and add it to end of word with "ay". …

Member Avatar for nickliutw
0
181
Member Avatar for manugm_1987

Hello everyone, I am very new to asp.net and asp.net mvc as well. I am stuck with the following problem please help. I have the following javascript [CODE]<script type="text/javascript"> var allMarks = []; google.load("maps", "2"); var geocoder; var lat; function initialize() { var map = new google.maps.Map2(document.getElementById("map")); map.setCenter(new google.maps.LatLng(37.4419, -122.1419), …

Member Avatar for manugm_1987
0
1K
Member Avatar for xDancinPoptartx

I am making an webpage where you get two random photos and you click using the arrow keys which one you like best and that one stays and goes on the versus the next random photo. I got it so far when you start the page it sets two random …

Member Avatar for xDancinPoptartx
0
105
Member Avatar for LondonJava

I have four JFrames open in an application. I wish for one of them to be the base JFrame, and when one of the others is closed than everything except the base frame will dispose. How do I link the other three JFrames so that when any one of them …

Member Avatar for hfx642
0
479
Member Avatar for begueradj

Hello people, I found a program on internet that reads 2 text files "maze.txt" and "randomMaze.txt" in which we can find *, space, S (for start) and E (for end). It resolves this maze by using DFS algorithm. My problem is that it does not run, it says there is …

Member Avatar for hfx642
0
184
Member Avatar for javabeg123

the main purpose of this application is to ask the user for head or tail and the output the numbers of guesses + the percentage of correct. Im having trouble with finding the percentage of correct. please help me fix this problem [ICODE] public class FlipCoin { public static void …

Member Avatar for hfx642
0
222
Member Avatar for Forte1292

Ok so I'm working on an assignment for my CS class. One of the methods needs to check that a string is a valid input and the easiest way is to use the .matches method. my method is [CODE] static boolean validateCourseId(String courseId) { boolean valid = courseId.matches("^CS [1234]\d\d\d$"); return …

Member Avatar for Ezzaral
0
160
Member Avatar for asif49

[CODE] import java.util.SortedSet; import java.util.TreeSet; ..... ..... ..... private SortedSet a = new TreeSet(); [/CODE] How will I represent that on a uml diagram since it's a sortedset and a treeset?

Member Avatar for Ezzaral
0
25
Member Avatar for nutan12

im trying to display 10 rows in a table. it workd fine upto displaying 10 records but im not sure how to add logic to go to next page to view next 10 records. below is my code; [CODE] <p><h1 class="TextHeading1" align="center">Search<a name=<%=outerKey%>><%=outerKey%></a>Result:</h1></p> <table class="TableBackgroundDB"> <% int limit = 10; …

0
51
Member Avatar for dayau89

/** * @(#)dayau_0.java * * dayau_0 application * * @author * @version 1.00 2009/9/28 */ public class dayau_0 { public static void main(String[] args) { int num = 30; String AnsHex = ""; AnsHex = DectoHexDec(num); System.out.println(AnsHex); } public static int DectoHexDec(int x) { String result = ""; int remainder …

Member Avatar for doomsday1216
0
289
Member Avatar for Mehnad

i have been asked to create a method that is capable of inserting a "Person" class into an ArrayList of persons. but all it says is that the types are incompatible. starting to think that the add method might not work in this situation. any advise would be greatly appreciated! …

Member Avatar for Ezzaral
0
939
Member Avatar for BDan

Okay I am fine tuning my program and would like to have a new JOption Message appear when a particular input is caught and have the exception message thrown. I am trying to get my input to come from my combo box but getting the cannot find symbol message". Am …

Member Avatar for BDan
0
431
Member Avatar for virtualvictory

My mini project is dictionary.I have finished retrieving meaning for a word from MS ACCESS database.But now i would like to proceed with it by playing the recorded voice of the corresponding word.Can anyone help me out in retrieving audio file and playing it using Win media player?thanks in advance. …

Member Avatar for NormR1
0
53
Member Avatar for JRDJ12

I'm wondering if someone can help me figure out my getAverageLength method in the following code: [CODE]package com.abc.text; public class StringProcessing { /** * Returns the number of non-null strings in the set. * If null or a zero-length array is passed in, then zero is returned. * If a …

Member Avatar for Ezzaral
0
2K
Member Avatar for programing

hi I want to implement this program correctly about plindrom like ( ara) is plindrom i try to writed code for non-recursivly but i didn't understand method CharAt () IgnorCase() [CODE] import java.util.Scanner; public class Plindrom { public static void main (String[] args) { String str; int left, right; Scanner …

Member Avatar for stultuske
0
190
Member Avatar for spades0001

I'm trying to create a program on NetBeans that allows me to load an image into an internal frame. Then I can click on the image and a box pops up, basically just like the one on facebook. Im done with the loading and image part. Now, I"m working on …

Member Avatar for NormR1
0
147
Member Avatar for Sadun89

[B][U]1.User.jsp[/U][/B] [CODE]<form action="register" method="post"> First Name : <input type="text" name="firstName" /> <br /> Last Name : <input type="text" name="lastName" /> <br /> Email : <input type="text" name="email" /> <br /> Username : <input type="text" name="uName" /> <br /> Password : <input type="password" name="password" /> <br /> <input type="submit" value="Register" /> …

Member Avatar for Sadun89
0
134
Member Avatar for Boobah

Hello! I am paypal ready to pay somebody 10$ to solve these three simple java questions. Will bump up the price if you are fast and persistent. 1. Given a String str1, write a segment of Java code that will count and print out the number of digits (0,1,2,3,4,5,6,7,8, and/or …

Member Avatar for stultuske
-1
137
Member Avatar for jaango123

Hi All, When I am trying to add a device, ibm the Datapower Managementperspective in Eclipse tool getting the below error. Updating version information - Error cause:java.security.NoSuchAlgorithmException:IbmX509 KeyManagerfactory not available Any idea, about this error. We are not getting any clue on this error. We added the certificate to the …

Member Avatar for rajparekh08
0
292
Member Avatar for daneuchar

[CODE]package aster; import java.util.*; public class master{ public static void main(String[] args) { ArrayList<Object> arl=new ArrayList<Object>(); Integer i1=new Integer(10); Integer i2=new Integer(20); Integer i3=new Integer(30); Integer i4=new Integer(40); String s1="tapan"; System.out.println("The content of arraylist is: " + arl); System.out.println("The size of an arraylist is: " + arl.size()); arl.add(i1); arl.add(i2); arl.add(s1); …

Member Avatar for daneuchar
0
1K
Member Avatar for hannah shrn j

[CODE]import java.io.*; class avlnode { public int data,bf; public avlnode lchild,rchild,parent; } class avl { avlnode root=null; avlnode p=null; avlnode prev=null; public void insert(int ele) { avlnode temp=new avlnode(); temp.data=ele; temp.lchild=null; temp.rchild=null; temp.parent=null; p=new avlnode(); prev=new avlnode(); p=root; if(root==null) { root=temp; } else { while(p!=null) { prev=p; if(p.data>temp.data) { p=p.lchild; …

Member Avatar for JamesCherrill
0
272
Member Avatar for nikk

Helo Friends, I have 1000s of image files(jpg/png) which I want to get compressed so as to reduce the file size. Quality can be compromised a bit. I want to know, is there any way in java by which I can get the image compressed? I found a code on …

Member Avatar for vkijust4u
0
321
Member Avatar for cutedollpisces

[CODE]import java.io.*; import java.util.Date; import java.util.Random; class Clock { static long now() // returns the current time in miliseconds { return (new Date()).getTime(); } } class IO { static int readInt() { String input = ""; try { input=(newBufferedReader(newInputStreamReader(System.in))).readLine(); } catch (java.io.IOException e) { System.out.println("Error while reading"); } return Integer.valueOf(input).intValue(); …

Member Avatar for masijade
0
287
Member Avatar for billingsj09

The assignment is to complete the implementation of a group of files that create and test a binary search tree. It takes in 2 text files of integers, creates a tree with the first and uses the second to compare to the tree and tell whether of not each integer …

Member Avatar for NormR1
0
765
Member Avatar for ecyarter

I can do it with a JLabel or a JButton, but can't figure out how in a JTextField. I thought I had found it (txtLonDay.setHorizontalAlignment(JTextField.CENTER)), but that doesn't work the way I want. I want all text entered in the field to be centered, and also all text that is …

Member Avatar for hfx642
0
6K
Member Avatar for cRazy604

Hello everyone, I am trying to create GUI for a given chat client below but I am having trouble starting it off.... I'm not quite sure if I should create a frame or to extend Applet inside so I can create the GUI if i can get any input it …

Member Avatar for cRazy604
0
236
Member Avatar for Java4A

Hey i have a program that i need to write where a user has to enter 3 names and then my program has to spit them back in alphabetical order. i know how to display the answers i just dont know how to code it to get the answer :/ …

Member Avatar for NormR1
0
93
Member Avatar for chriswinter

I have a orpaned case error and im not sure where i am missing anything. Probably just needs another set of eyes to find it. thank you in advance Here is the error code : C:\Users\winte497\Documents\FSMValue.java:109: orphaned case case 6: if ((ch >= '0') && (ch <= '9')) Here is …

Member Avatar for chriswinter
0
196
Member Avatar for Labdabeta

I need to clear the output console buffer from within java on a windows console. I was thinking of a batch call to "cls" how can this be achieved? [CODE]public static void cls(){ //clear the screen pretty please! }[/CODE]

Member Avatar for thines01
0
114
Member Avatar for spades0001

Hey guys! So, created a File Chooser that gets a picture. And I want the program to display the picture on the jFrame. How can I accomplish this? I'm using NetBeans, and I'm still kinda new to it :P Thanks guys! :D Here's my code: [code] import java.awt.image.BufferedImage; import javax.imageio.ImageIO; …

Member Avatar for mKorbel
0
247

The End.