35,619 Topics
![]() | |
[code]//This is the coding that I have done in delete item private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here int selectedIndex = jList1.getSelectedIndex(); jList1.remove(selectedIndex); }[/code] its throwing following Exception [code=text]xception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1 at java.awt.Container.remove(Container.java:1132) at musicplayer.jButton2ActionPerformed(musicplayer.java:144) at musicplayer.access$100(musicplayer.java:23) … | |
The error is: class, interface, or enum expected. I've never seen or heard of this error before surprisingly, and I've written all of my code the same way, so I'm not too sure what's wrong with. I've put red arrows around the lines in question. Thanks in advance! [CODE]/* Hangman … | |
[B]can anyone help me to draw clock cycle in java using swing when i give 5 clock then it will show me 5 clock cycles[/B] | |
Hi guys... Is it possible to stop opening multiple instance of a jar file... I just want to open my application only one (only one instance) at a time. | |
Write a Java program to demonstrate the use of inheritance, polymorphism, interfaces and transaction processing. This program will also use the Vector class. Class Definitions: You are to begin with the following class (Account.java): *bottom of post* [CODE] public class Account implements AccountAction { protected String accountNo, institution, name; protected … | |
Directions...Write a program SumOfOdds that has one main method that asks the user to input two odd integers where the first is smaller than the second. The program ouputs the sum of all the odd integers from the smaller output to the larger output. You must use a while loop … | |
What does the $ means, EventQueue$1.class(Red marked) Attached picture [URL="http://i39.photobucket.com/albums/e179/iamcreasy/Untitled-6.jpg"]http://i39.photobucket.com/albums/e179/iamcreasy/Untitled-6.jpg[/URL] I am using NetBeans. | |
Hi All, I need to have a Regex that will not allow just spaces, but it can allow sentences with spaces. It should allow any special characters that occur as well. Actually, it is for a text area of comments. So i want to restrict him from entering just spaces. … | |
I am making a Gui for an inventory. And I want for each time a person presses my next button, the jLabels to display the next item in the arrayList. Right now I'm stuck as it only displays the last element, Any help please? [CODE] // action on the button … | |
import java.util.Scanner; public class Student { private String FirstName; private String LastName; private String Address; private String PhoneNumber; private int Credits; private double Tuition; double Health_Care; double Late_Fee; double Meal_Plan; double TotalTuition; double IncidentalFee; private boolean state; private boolean LateFee; private boolean CampusFood; private boolean HealthCare; public Student() { } … | |
[CODE]public class Order { private int widgets; private double price; public Order(double undiscountedUnitPrice) { price = undiscountedUnitPrice; widgets = 0; } public void addWidgets(int quantity) { widgets = widgets+quantity; } public double getTotalPrice() { return price*widgets; } public double getUnitDiscount() { if(widgets>10000) { if((widgets-10000)/1000>47.5) double toTakeOff = (((widgets-10000)/1000)*.10); price = … | |
Directions...Write a program SumOfOdds that has one main method that asks the user to input two odd integers where the first is smaller than the second. The program ouputs the sum of all the odd integers from the smaller output to the larger output. You must use a while loop … | |
hello all I have one textField and one textArea. How to move the cursor to the end of Text of TextArea when -cursor is in textField,and keyboard [Enter] pressed thank you denny | |
can someone help me to fix my codes.I am receving some errors.This is my first time i am using stack in GUI. [CODE]import java.util.Stack; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.Scanner; public class CalcGUIPanel extends JPanel { //=============================================== instance variables //--\- Component referenced during execution private JTextField … | |
can anyone tell me how to make appear a jframe in a slow motion in java i'm using netbeans editor.............. | |
[B]I have been given a chunk of code from my teachers, and I just need help getting it to run. I'm very new to java so any help is much appreciated. Here it is:[/B] [code] import java.util.*; import java.io.*; public class CourseStats { static String[ ] studentNames; static int[ ][ … | |
Hi there. This is actually one of my assignment and i am having problem with the do while sentinel looping. The result i get is totally inverse from the one i expected. The system is supposingly ended when user enter 0, but it ended when user enter any value but … | |
Hi, I am making a program where the user has to input an integer with LESS than 5 digits. If he enters more than 5 digits, I want the program to print: "ERROR" How can I do that? I wrote this code till now. Do I have to use a … | |
hello ! im trying to read few numbers from a file and but each line of numbers in diffrent array now i can read the numbers but in one array any help here is the code [CODE] public static void main(String[] args) throws IOException { File number = new File … | |
i am creating an audio Player . I just wanted to implement this particular iTunes software feature i.e COVER FLOW , in which songs appears in thumbNails and with the help of left & right arrow keys we could scroll the playlist I was wondering if anyone could help me … | |
So I have to program this MVC GUI of a checkout line. I have a gui that has 10 registers. Each register has a queue of customers. There is a button that when clicked, will generate a customer and the customer will be entered in the line with the shorted … | |
Hey guys, I have an Jlabel class and trying to simply add it to the panel in my main class. However is nowhere to be seen! No errors are being output so currently have no idea what wrong...unless you can see whether my method is wrong... Jlabel class: [code] public … | |
I'm new to web development. I'm using JSPs and need to access a stored procedure (SQL) in order to draw information from a database table, parse the data, and display the parsed information. How would I (conceptually) approach this? | |
Hi guys I have written a class that uses a frame and Swing components. Unfortunately the traversal policy that i wrote does not seem to work for the jmenu. Can u guys help me fox it....much appreciated [code] public class MainFrame extends JFrame { //<editor-fold defaultstate="collapsed" desc="Variables"> JMenuBar jmb = … | |
I have the folowing code so far which outputs the make and price of a car,but i cant seem to figure out were to add the discritpion of the car so that it can also be diplayed.HELP! i tried adding discription[k] = st.nextToken(); but the program did not run. [ICODE]import … | |
Hi, An urgent help is required. I need to display colored font in command prompt during execution of a java program on Windows Machine. I am unable to do so and while I searched for online help I came across JANSI library. Is there any other simpler and better way … | |
Hey All! New to here, but I have a couple questions: How do I find Average word length, and how to I printout the occurrence of each word size? Needs to look like this: [CODE]length frequency ------ --------- 1 3 2 13 3 24 4 13 5 10 6 2 … | |
Can you please tell us, free gold and silver rate service provider for RSS . And also give whether casting service provider RSS feed.. need java script above mentioned or XML file. | |
Directions...Write a program SumOfOdds that has one main method that asks the user to input two odd integers where the first is smaller than the second. The program ouputs the sum of all the odd integers from the smaller output to the larger output. You must use a while loop … | |
I am writing a program that gives and grades a test. Currently I am working on reading in the text from a file to administer the test, but am running into limitations. So I have a couple of questions. Is there any way I can read in a segment of … |
The End.