32,204 Topics
| |
I'm supposed to allow the user to draw shapes based on their combobox choices (eg. line, rectangle, circle), colour, fill state, etc. However, nothing is showing up. Model class: [CODE]import java.awt.Color; import java.awt.Graphics; import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.JOptionPane; import java.awt.event.MouseAdapter; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.MouseEvent; public class DrawPanel … | |
hi .. i wanna read text file in binary format ... 4 ex : lele and raz ..."in text file " l=10011001 e= 011110011 ..... "cmd (8 bit per letter)" and but them in an array ...i tried the type StringBuilder but it didnt work ... i need a method … | |
Hi, I'm new to Java and am having a problem getting my program to run, any help would be greatly appreciated. Here is the program: [CODE]//This program displays a message asking the user if they //want to know the Top Premiership Players. If they say Yes, //they will then be … | |
Hi, Im new to java and was wondering if someone could help me with my problem. Im writing a program which will calculate how long a journey will take, the user will need to enter a character to represent what type of road/speed they are doing and how long the … | |
hy im having a little problem with a loop with jgrasp here is my basic program [code] import javax.swing.JOptionPane; public class loops1 { public static void main (String[]args) { String name do { String name = JOptionPane.showInputDialog ("who is the cleverest person in the room?"); } while (name != "erin"); … | |
I am doing a project on a network printer spooler. I want to know what APIs are available in Java to interact with a printer. | |
import java.io.*; public class EggTrader { public static void main(String[]args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int numofEggs,EggCount,Cash; double cashOnHand = 500; double pricePerdozen = 72; double unitPrice; public void buyOneDozen(double pricePerdozen) { numofEggs = Integer.parseInt(br.readLine()); numofEggs = getEggCount(numEggs,cashOnHand); } public void sellEggs(int numEggs,double unitPrice) { numofEggs = … | |
how do i write a program that a user can input 3 numbers (between 0 and 100), then the program will compare if the numbers are bigger are smaller than each other, and weather each number is smaller than 100 or greater than 0. required 2 class file in one … | |
Does anyone know why Hibernate and Struts are referred to as a Single-tier framework when compared to Spring?. | |
Hello I am trying to underline --> 1 5 6 only the 1 2 2 2 only the middle 2 1 6 4 only the 4 I have imported the java.awt.* but im not sure how to write the code, the java api is a little confusing. [CODE]import java.awt.*; public … | |
I have a two input text field window in which users input an ID and Password. I then need to compare these passwords to allowable users. What would be the best method for associating each unique password with its specific user id? | |
i am new both to this forum and to the programming world but I know a little of java programming, html and am really interested in becoming a full time java programmer or developer.. But get confused when i read about visual basics Pls i need clarificatiions and opinions thanks | |
Hi Guys! I am doing a shopping Mall Project! I want that you people give me suggestions in order to make this project perfect... Regards Nouman Ayub. | |
//less than 10= "too cold", 10-20= "avarage", 21-30="hot",bigger than 30 ="Too Hot" import javax.swing.JOptionPane; public class TmaTwo { public static void main(String[] args) { int number; int temp; String numString; numString = JOptionPane.showInputDialog ("Enter temperature:"); number = Integer.parseInt(numString); if (number < 10 ) JOptionPane.showMessageDialog(null, "Too cold", "Output", JOptionPane.INFORMATION_MESSAGE); else if … | |
How to use delay function in turtle class in java,oop when drawing an object | |
Hi, I am a student who has been given the following assignment. Before I am reprimanded for posting asking for assistance without providing an attempt at code, please allow me to explain. We have been given the assignment shown below with no explanation. We have not covered any of the … | |
Hi :) Is there any way to look up a character's Unicode line number? Ex. Capital letter A's line number (hex) is 41 capital B is 42 etc. (more info [URL="http://www.utf8-chartable.de/"]here[/URL]) Or would I have to put them in an array manually? thanks :) | |
hello everyone i am creating a notepad using java swings. how to save the text in textpane with font styles ...... | |
Hi all, I'm new to JTable. I have two buttons "add Row", "Del Row" and I have some records displayed from db which contains an auto increment column. when ever "add row" is clicked a new record will be added to JTable with a auto increment column number displayed in … | |
Hey guys, I'm using a Point array to transfer to my panel class that draws the image. The reason I'm using coords is because it shows where the character is in the tileset for directions Ie. (20,5) is right step facing up. anyway its coming up with null pointer and … | |
its java assignment i dont know how to do this part allow user to determine whether a given (whole ) number is a Fibonacci number or not print massage on the screen with the result of your option: either the number is a fibonacci number or the number is not … | |
Hi everyone, I'm developing a new program. ;) My "dilema" is as follows: :S Let's say that I have a Java component, a calendar, shown in the GUI and I want to cover it with and invisible label or something so it can't be modified by the user. I don't … | |
I'm having a problem completing the question below. I am a Java noob so be gentle ;0. The problem is in relation to the equals() method. I have to use this method to check dates to see whether they match. Please see code below. [CODE]public boolean equals(){ if(date1==date2){ return true; … | |
Hi guys. I am having issues with a program I am writing. Basically, I have a JList that stores toString() references of "Location" type objects. I want to be able to remove these. However, the "Location" type objects are stored in an ArrayList, hence requiring an overriding toString() method to … | |
Hello, i made a basic java desktop application. After building the interface in the form, i compiled it and it worked perfectly. But after i added an event to a button (on click) my app won't close. I use the X button from the title bar, or ctrl+q from the … | |
| Hi viewers, I'm in dire need of some help. I'm currently doing a program for my studies and I have successfully compiled it and tested it. However when I try to execute the program it comes up with the error java.lang.NoSuchMethodError: Main. I've identified the problem which is the fact … |
Hey please I am trying to create a chat system but my main server routine in my server class keeps give error saying its out of bound. I think it is the port number but dont know how to fix it. Is there anyway I can hard code the port … | |
I have this function which computes the position record of 6 requests. ( ie x,y,dx,dy--these are the position records for a request) I want to display these position records in a textfield, which i have in my GUI, as soon as i press the "positionrecord" button. I am able to … | |
[B]Hi I am trying to create a generic class form existing code I have tried to figure it out but with no avail if anyone could help it would be much appreciated I have tried to do it and this is what I have so far[/B] Here is the Class … | |
I am having issues getting my code to work properly. The objective of the program is to allow the user to enter 5 scores and then it is supposed to calculate the mean and rearrange the data set from highest to lowest (descending order). I am supposed to run it … |
The End.