32,199 Topics
| |
Hello everyone, I am new at Java(android)-before I have little information about Java lang- and in particular socket programming -before I do not know nothing about socket client server programming-, previously I wanted to write simple chat program by using Threads and now I pass this step, two android emulators … | |
Hello everyone, When using the following source codes to play a local .wav file, I always find .wav files can not played. Does anyone know what is the trouble? [Code] import java.io.File; import java.io.IOException; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.FloatControl; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; public class … | |
Compiles fine. But at runtime it gives ClassCastException. My doubt is that why is it so even though st which is of type Sample1 gets casted to Sample2 and generates exception even though Sample2 IS-A Sample1. | |
I have an odd problem with a Java-based Internet program that I would like to use on a regular basis on my Windows XP computer. I have not done Java programming, so I would be interested to know if anyone has ideas about what might be happening. The program runs … | |
Iam working on a attendance management project to get inputs from fingerprint scanner and save it into mysql database such as date and time and also to vertify the staff members. If anyone could assist it would be a great help. | |
I'm a beginning programmer and am stumped on the last part of this assignment. I can't seem to figure out how to have the Letter Grade show. Here's what I have so far, any help as to where I'm going wrong would be much appreciated!! import java.util.Scanner; public class Lab1 … | |
public static void drawIndentedLine (int spaces, String begin, int n, String middle, String end) It should print a single line, terminated with a newline, that begins with the specified number of spaces, followed by the begin string, followed by n copies of the middle string, followed by the end string. … | |
How to add TrustStore file to cacerts in JDK 1.5 | |
package cs1410; import javax.swing.*; public class P2 { public static void main(String []args) { drawDiamond(); } public static void drawDiamond() { int x,y,z; int a=1; String out="\n"; int i=Integer.parseInt(JOptionPane.showInputDialog("Enter your size")); if((i%2)!=0) { int in=(i/2)+(i%2); int bb=in-1; int b=bb+(bb-1); for(x=in;x>0;x--) { for(y=x;y>1;y--) out+=" "; for(z=0;z<a;z++) out+="*"; a+=2; out+="\n"; } for(x=0;x<in-1;x++) … | |
Write a program that does the following: a) creates an array of user specified length of random integers between 0 and 100. b) allow user to print array in ascending or descending order. c) allow user to search for specific int value (you can use your code from part 2) … | |
1. Write a program to compute the annual rate of return on an investment. The program will ask the user for the original purchase price, the number of days the investment was owned, and the final sale price. The program must then print out the difference between sale price and … | |
My program on compound interest gets compiled fine but it won't display anything . Yesterday When I created a new class and tried to run a simple for loop , the same thing happened . But when I tried to run the same for loop in a previously made class … | |
I have a 2D array and i am trying to look for Similarities in the data, via number patterns. For Example: 1) 3,4,5,6,7 2) 1,4,8,23,56 3) 14,15,16,34,45 Now what i would like to do is search this array to find patterns like in example 1. it goes 3,4,5,6,7 or in … | |
Hello everyone, I have problem with my simple android chat program when using different test debugging. I have two android emulators one reads SERVERPORT as 8080 and CLIENTPORT as 8082 and the other android emulator reads SERVERPORT as 8082 and CLIENTPORT as 8080 from a given txt file. Here there … | |
Hello again, I have been posting consecutively in these days nearly same topics, actually I am intern at a sofware company and our company ask to perform the proof of conception about sending voice call -at the beginning- and finally video calls, like walkie talkie application; as you have already … | |
Hi ! I have a JFrame which contains some textfields and buttons. imagine a situation that a user wants to fill sth in textfield, then she/he needs more textfields to be shown ! I want when the user clicks a button, more textfields will appear ! its like cc/bcc in … | |
hi how to install jdk and eclipse j2ee IDE on "Ubuntu Desktop 12.04 LTS" thanks for your time | |
When you enter "y" and try again. it doesn't asks you to "enter a String: " and "enter another String: " again. It just prints those lines out but you don't get to enter. Well~ you can enter 1 string again when it does the loop but I don't know … | |
Hi, I just started working with Java for a class and Im a little confused. My code is supposed to convert seconds to hours, minutes and the remainder of seconds. for whatever reason my answer is 8 seconds off of what it should be. The example I was given is … | |
Hi, I am struck in accessing c functions from java. I have .lib file and 5 dll files which are interdependent. I need to access the c functions in java. Please help me. i have no idea on this. Thank You, Sagar | |
Hey just a question to prove me right or wrong. I am wondering what the 'this' in the following code refers to in terms of my applet. mainThread = new Thread(this); I believe that it refers to the run method which defines the thread. I was told I was wrong … | |
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package buttontest; import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * * @author noorulrafiedza */ public class ButtonTest extends JFrame { private JButton Button , Button1,b; private JPanel Group; private JCheckBox cek1; … | |
I have to create a java program using either a regualr array or arraylist so I chose arralist and I named it horses but now have to create another method with in the programming inorder for a user to input/search for "trigger" and if it is found it shows the … | |
This is my program for Biodata in applet using JFrame import javax.swing.*; import java.awt.*; public class Biodata extends JFrame { JLabel jlname,jladd,jlmobno,jldob,jlgender,jltab,jlhob,jllang; JTextField jtname,jtmobno; JTextArea jtadd; JComboBox jcd,jcm,jcy; JRadioButton jrm,jrf; ButtonGroup bg; JTable jtedu; JScrollPane jsp,jshob; JList jlhobby; JCheckBox jc1,jc2,jc3; JButton jb1,jb2; JPanel jpr,jpcombo,jpcheck; JFrame jf; Biodata() { jf=new JFrame("Biodata"); … | |
I am supposed to use this method public static void drawIndentedLine (int spaces, String begin, int n, String middle, String end) This is what I am suppsed to do **It should print a single line, terminated with a newline, that begins with the specified number of spaces, followed by the … | |
public class Student{ private String name; public Student(String name) {this.name=name; } public void setName(String sett){ name=sett;} public String getName() {return(name);} } public class Swaptest{ public static void swap(Student p,Student q){ Student temp; temp=p; p=q; q=temp; } public static void main(String a[]) {Student s1=new Student("John"); Student s2=new Student("Mary"); swap(s1,s2); System.out.println("s1="+s1.getName()); System.out.println("s2="+s2.getName()); … | |
Please can anyone tell me how to convert an ArrayList<Integer> to byte[] Thank you | |
I would like my vb2010 program to click on a javascript element on this webpage depending upon what they choose, here is the source of the rating system, thanks in advance: <div class="basic-info-rating basic-info-user-rating" style="display:none"> <div class="rating quick-rating"> <p class="average rating-3">3 stars</p> <ol class="user" data-analytics='{"click_id":1865,"events":"event6,event7,event24"}' data-ypid="5550608"> <li class="rating-1"> <a data-analytics='{"rating":1}' … | |
hi all, Good noon. I am trying to get the match a key word from text, get the input from text and if the match in the text matches with the input. I need to get the result of that. If the word starts in the middle i should not … | |
trying develop a Russian/English Flag game, given the flag image you choose in Russian or in English modes... Since English country names get from country file image names, can have a Java generic Map key=englishCountryName & value=inRussianEquivalent.... to do the Russian part??? Or exist other way? if you think this … |
The End.