32,199 Topics
| |
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 … | |
| 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 … |
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 … | |
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 … | |
[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? | |
/** * @(#)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 … | |
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! … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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); … | |
[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; … | |
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 … | |
[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(); … | |
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 … | |
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 … | |
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 … | |
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 :/ … | |
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 … | |
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] | |
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; … | |
Hey, I've been recently coding a java program for the High Low dice game. I'm absolutely sure of my logic in that I know what i have to do, it's just executing it. Methods and how to call them are my main crux. I'm stumped at the moment, and I'm … | |
Hi, I am suppose to run a for loop into an array of 26, 6 times. The point is to gather the six largest numbers and put them in ascending order. I have been trying everything for this and cannot come up with a solution. The directions I am given … | |
| Hello people I have a JFrame which container is a JPanel: can you give me a piece of code that shows how to create a grid of rectangles ? I need this information for my poject Thank you |
I am trying to learn more about using HashMaps in java. I would like to write a program that searches through a list of jumbled words from one text file and returns the unscrambled word(s) from another text file. Any suggestions how to do this? | |
| The code I pasted is for a school assignment where we have to calculate the monthly payment for 3 different loans, with varying interest rates, and then display some information about each payment for each of the 3 loans. My code compiles and runs fine (not finished commenting all the … |
The End.