32,204 Topics
| |
[CODE] private JButton[] buttons; private static final Character firstChar = 'A'; private static final Character lastChar = 'D'; /** Creates a new instance of ButtonPanel */ public ButtonPanel() { buttons = new JButton[4]; setLayout(new GridLayout(2,2)); Character label = firstChar; for (JButton b: buttons) { b = new JButton("" + label); … | |
Hi, i'm trying to copy all txt files from a directory into one file to another directory. But i have the following error: "FileStreamsTest: java.io.FileNotFoundException: . (Accès refused)"" My txt files are located in the project folder of NetBeans. here is my code: [CODE]package FileStreamTest; import java.io.*; class FileStreamsTest { … | |
This is my sample application which provides result as follows: [CODE]Array Values : arr[0][0] :6 arr[0][1] :0 arr[0][2] :0 arr[1][0] :0 arr[1][1] :0 arr[1][2] :0[/CODE] am using the jQuery Highcharts: [CODE]chart = new Highcharts.Chart({ chart: { renderTo: 'container', defaultSeriesType: 'column' }, title: { text: document.chart.chartTitle.value }, series: [{ name: 'USA', … | |
Hey again, I'm having another problem unfortunately. We were asked to create a tree that has binary tree properties as well as max heap property. (take A(7),C(8) and B(3) ; the tree should be so that the it should alphabetically represent a binary tree and numerically represent a heap) I … | |
How do I put the jar file in eclipse inside the workspace folder so it does not have to be re linked or re path changed when I use it in another computer. Currently, my problem is that even when I keep the JDBC MYSQL connector (jar) file in the … | |
I have the following problem and I dont undesratnd how to use arralists to implement. I have a customer class which I want to hold some primitive data types as name , id , address etc. To implement this using arraylists I must declare it as below? [CODE]Arraylist Customer =new … | |
Hi guys, I've been looking into reflection and was wondering if anyone had any good tutorials or a good use for it. I understand how it works but can't think of an example of when it would actually be used. A website with a task that needs reflection to solve … | |
I am new to JSON... I have been told to use it with XStream in my project.. I searched on net... But, I did not get any satisfactory information.... So, can anyone please tell in simple language what is JSON n basically why is it used? | |
I have a problem with this code and I do not know what is causing it. [CODE]// The "ArrowKeys" class. import java.applet.*; import java.awt.*; import java.awt.event.*; public class ArrowKeys2 extends Applet implements KeyListener, Runnable { int x = 50, dx, y = 50, dy, a = 0, score, total, locx, … | |
Hello I want to develop a program in which I query a string to any search websites like Yahoo,Bing etc.. and get search results(only the websites) to display in a list box.So is there any way to get the search results ? Thanks From Satish | |
Hello All, I have confusion in command Class. Its constructor has 3 parameters. First 2 parameters I can understand. but [CODE]Command.Screen[/CODE] and priority parameter I could not understand. I tried to Google also, and refer different kind of ebooks, but still i cant understand. So please help me. | |
I have a label,4 radio button.I have retrieved data from sql.I need to display the retrieved question in label and its 4 option in each of radio button.I got it working to display one question.my trouble is in button click.when next button is clicked question should change...any more ideas is … | |
| |
Dear All First of all I wish you a very happy new year. I have been trying to understand the depreciation matters. As you can see in the codes below, There are 3 handleEvent methods used as pressbutton action , radio button selection action and dropdown list selection action. Now … | |
I am working for online examination project. my work is to generate random number without repetition. i tried and i am getting numbers to be repeated sometime.... I need to know how to check the repetition in the generated number. random r=new random(); for(i=0;i<10;i++) { int j=r.nextint(10); System.out.println(j); } | |
HI, I have now for more than 24 hours tried to figure out how I return the index number of the second smallest integer in an unsorted array. Some how, I do not get the index number returned, can any one see what I´m missing? As the program runs now, … | |
how do i go about making a java music player? i have very basic knowledge in java and i learn best when i jump into a project..which in this case is a music player i would like it to play mp3 files with a nice looking GUI unfortunately...i have no … | |
ok i want to make a program to show a teacher at my school so i can get into computer Ap which teaches you java(but they say u have to know stuff to get in it makes no sense i am in highschool). here is some seudocode and the code … | |
Dear All, I'm taking a course online for school on how to code with Java. My current assignment is to have the computer read in a text file and make it split it into 5 different arrays. I am really bad with Psuedocode so if you answer like that it … | |
Hi, I need help with an assignment for a class I'm taking. The assignment requirements are as follows: 1.Carefully study the class structure in Products.java. Here is Products.java: [CODE]abstract class Product { protected float price; // return the price of a particular product abstract float price(); } class ComputerPart extends … | |
Pleaseee help me guys. I can't figure out why the elements in my array are null. I'm reading in from a file and take each line and saving it as a variable in the object and then adding the object to the array. This is what I have so far...when … | |
I'am beginner in Java, and I'am having a lot of problems while typing or making the sum of numbers. The fact is that I want to calculate the sum of pressed numbers until I press -9999, meanwhile when I press -9999, I want program me to show the sum of … | |
I am trying to refer to the class a nested class is 'in'... The 'this' keyword refers to the nested class, so I need something like super.this (except not at all like that) :/ I think the code below describes what I am trying to do: [CODE]public class Nest { … | |
Hi, This is my first forum post and I'm very new to both the daniweb and programming community. I've been working on a project for a month or so and it involves clicking JButton to change the values of the text associated with the JButton clicked. Everything runs fine except … | |
Hi I am new to Java. I am trying to develop a tool in which I am trying to download a file from a link. When I go to that link using my java program, IE is opened and its default File Download window is showing. But I need to … | |
How can we set a default path in our system to save a downloaded file in the "File Download" dialog box of Internet Explorer using a java program? | |
Hi guys. I have previously been developing a Java application using 2 Windows Vista PCs that both have MySQL as the database. I have always created a user for each PC (specifying their IPs as allowed hosts to connect) on the other and then in the application the code for … | |
Hello to all. I have build a Java GUI application and now i want to convert and transfer it to an applet. I assume that whatever i have in [CODE]public void main[/CODE] will now go to the init() method of the JApplet. Now the problem is to embed it to … | |
Can any one help me how to make a Java Application GUI independent of screen resolution.. Now my application uses jFrame and it gets problems when resolution of screen changes.. plz help... | |
[code] //Address Book Part 1 //IT 215 //George Williams import java.util.Scanner; class menuOperations { //Initilize Arrays to store information String[] fNames = new String[5]; String[] lNames = new String[5]; String[] dAddress = new String[5]; String[] dCity = new String[5]; String[] dState = new String[5]; int[] dZip = new int[5]; int[] … |
The End.