36,051 Topics
![]() | |
its my code for printing array of buttons with values R and B but i m not getting the output.. first of all i want to askk can we use random method in value field of button i,e value="<%=Math.floor(Math.random() * ('R','B'))%>" if no then is there any other way to … | |
Ok I'm just looking for a cleaner way to achieve my goal here, if there is one and if this is not much of a satisfactory method. The goal is to accept an integer from a user using JOptionPane.showInputDialog. A brief example of what I'm currently doing do { check … | |
Hello I ma trying to practice on Data structure using java. I solved a lot of problems but this one looks interesting but I need some help understanding what I really have to do ... > write a program that simulates the operation of a busy airport that has only … | |
Hi DaniWeb! I kinda need your help on this little bugger. How can I input this CSV file in to an array? Module Name, Module Code -- Student ID, Last Name, First Name, Exam Score, Average Introduction to Art Life, ITAL 07,Krave,Mark,27,30 60,Lever,Paul,89,96 13,Green,Jon,15,40 15,Davids,Jerry,5,15 If the Module Name and … | |
I have to write a program where I take user input and print out how many times each word prints out. Here is my code: import java.util.Scanner; import java.util.ArrayList; import java.util.Arrays; public class wordlist { public static void main(String[] args) { int i = 0; int USER_MAX = 50; String[] … | |
The question is pretty straightforward, does BigInteger have a limit? From what I know it is only limited to the amount of memory available on the system, nothing else. This question arose when my instructor told me that one could not calculate 50! using BigIntegers, which I believe one can. … | |
Hello guys, im trying to self study about connecting java to mySQL database. it's been a while since i used java, so i forgot some of the codes a little, and im also not so good at it. So im trying to connect, been copying and pasting codes trygint to … | |
Hello, I have to write a program where I need to take an input from the user, a phrase with words seperated by spaces, and then print the phrase and show how many times a word is used in the phrase. I'm a beginner, I would like to know how … | |
hi everyone. i've used the following way to store the uploaded files into D: drive of my windows machine from Tomcat server and it works pretty goood. private final String directoryPath="D:\\uploadedFiles\\"; File f=new File("D:\\uploadedFiles\\"+fileName); InputStream in=file.getInputStream(); OutputStream out=new FileOutputStream(directoryPath+fileName); byte[] buff=new byte[4096]; int count=0; while((count=in.read(buff))!=-1) { out.write(buff, 0, count); } … | |
Hello Guys, I am facing problem while i am create menu system using swtich statement. I have 3 level of menu but don't know how to go back to main switch Statement. For Example currently I am in 2nd level of switch but how to go in main(outer) switch. Please … | |
I have a lottery program nearly completed, thought i had the last of the problems sorted but it seems i did not!! The program has a couple of issues. 1: Everytime i click a button it stores what i clicked, for example 10, and also creates a random number. Problem … | |
I am making a project in Number Theory and i want to display some formatting text in a textArea in my Gui. I have a method named padding which takes an integer as an argument and return a String consisitng of a number of spaces. This number is 12 - … | |
Somebody help me, i'm a beginners of the java language, but in my interested to learn a java. and I create a GUI but the MDAS formula is not there, it because i dont know how to solve that, it cause need a pop and post function for the Calculator … | |
Hi Everyone, I have a fairly simple (atleast it seems to be one) assignment loop program to create. But, unfortuntely having trouble getting started because I took a break from Java and now that I have decided to pick up with it again I feel like I've forgot everything. So … | |
I have a routine that requests an administrators approval for access to protected data. for security the adminsirator needs to know what data is requested. The following routine gets the password without any problem: public static Boolean Confirm_Change() { Boolean test = false; JPasswordField pf = new JPasswordField(); int okCxl … | |
So I need all I need to do is let this info that is going through my array print out somehow. the problem is I cant get it to do that currently. I can get it to return the information one at a time for each employee . but at … | |
hi everyone! I want to get the output of my c++ application from my jaca applacations o i use a file abs.bat to get it done i used this code in .bat: start readxmlresou.exe that commande line opens readxmlresou.exe that is in my desktop and execute it, now i want … | |
Hi I am looking some advice on which Java tools to use and /or any hints you can offer a new Java user regarding XML. What I want to do is take an xml file read it, modify it and push it to a database so that it can update … | |
Hi... I'm a new user here. I've stumbled across this place on a couple occasions in the past, and it worked out to my advantage when I needed a little help with some coding assignments. i need to include "parenthesis" in the equation in my program but i dont know … | |
plss give me some code to have an idea for my program | |
I am writing this program that takes a file of integers, sorts the integers, and prints the sorted list into a different output file. I have all of this working fine, I am stumped as to how to incorporate a counter. I want to print the number of times a … | |
//MY Problem is that i'm trying to make a lottery program, the issue i have is when i click a button, i want it to be so that after i click 6 buttons, lets say ,1,2,3,4,5,6, the program will move onto the next stage( i have yet to build that) … | |
So I need to convert the Date to a string in the DayofBirth JOPtionPane areas that starts on lines 43 . it is originally defined as a date and must remain so. The book I am reading recommended using .toString() well that was useless or I just could not figure … | |
Hi i am a computer science student. i am planning to create an aplication that:Determines the bandwidth allocated by ISP, determines load on the bandwidth at a particular time and also determines the unit that is using most of the bandwidth.I would like to use java. may you advise if … | |
I have the elements to create XSD in the DB. such as a sample row would be.. XSD_TAG XSD_DATATYPE TYPEDEF MAXBOUND MINBOUND PARENT reject string basic null null sources so basically says that one of the tags to be constructed would be reject and it is of type string. the … | |
I have a 8 digit number that is an int, and would like to know if there is an equivalent method that i could use on it like charAt(). or a way to take just one digit out so that it is still an int value and be able to … ![]() | |
Hi Below is a code sample i copied from the book that i am reading.But i need explanation on why creating a reference to the figure(Eg: Figure figref;) when each reference for the individual class is already been declared. Like if i need the area of the rectangle,i could have … | |
I am interested to get ActionEvent generated by multiple components from another class... please help. Example is given below. class MyFrame { public MyFrame() { JFrame window = new JFrame(); Container c = window.getContentPane(); c.setLayout(new BorderLayout()); JButton btn1 = new JButton("Save"); JButton btn2 = new JButton("Delete"); c.add(btn1); c.add(btn2); EventHandler handler … | |
Hi All, I have a questing regarding JTable. If i have two rows in JTable. if user selects a column in a particular row, I need to have the value of that particular column and also the values of rest of the columns in that row. Please advise how to … | |
hi everyone! I have 2 applications, one coded in C++ and the other coded in java, i want to launch the one coded in c++ from the other one, honnestly i dont know how to do it at all i use eclipse and VS2010 any ideas about that??? thank YOU … | |
I just created an empty HTML5 project and could not run it through the new Chrome netbeans Connector feature. I have added the netbeans connector extension to my chrome browser, but I keep getting this warning "Could not access Url through external browser. Check browser configuration." I have the latest … | |
In the following piece of code i am trying to enter a 8 digit binary number then manipulate each digit seperatly. import java.util.Scanner; public class binCoverstion2{ private static Scanner kbd = new Scanner(System.in); public static void main (String[] args){ int bit0, bit1, bit2, bit3, bit4, bit5, bit6, bit7, decNumber; System.out.println("Enter … | |
I am writing a program that a user inputs a 8 digit binary number and I need to convert it to a decimal number. I am trying to figure out a way for the user to enter the binary number without any deleminators, but be able to manipulate each digit … | |
Hello, I am in learning java. I try this code that I got from internet : static void insertionSort(int[] A) { // Sort the array A into increasing order. int itemsSorted; // Number of items that have been sorted so far. for (itemsSorted = 1; itemsSorted < A.length; itemsSorted++) { … | |
import java.awt.Color; import java.awt.event.ItemListener; import java.awt.event.ItemEvent; import javax.swing.*; public class framed implements ItemListener { JToggleButton jtButton; public JPanel createAndShowNewPane() { JPanel GUI= new JPanel(); GUI.setLayout(null); JPanel buttonPane= new JPanel(); buttonPane.setLayout(null); buttonPane.setSize(200,300); buttonPane.setLocation(0,0); GUI.add(buttonPane); jtButton= new JToggleButton("On"); jtButton.setSize(90,50); jtButton.setLocation(100,0); jtButton.addItemListener(this); buttonPane.add(jtButton); return GUI; } public static void window(){ JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame= … | |
how can we form a 2d array in jsp so that we can select its element just by clicking on the particular element.. | |
Hello I am J2SE programmer and now university authority give the task select the final project topic. Kindly aany body suggest me the 5 or 6 project ideas... | |
I am trying to cut an image that I have uploaded into a java written program into quarters, specifically a pyramid. Every pyramid level will have a corresponding image, for example given an input image of abc.pgm, you will generate output images abc1.pgm for pyramid level 1, and abc2.pgm for … | |
Hi... I'm a new user here. I've stumbled across this place on a couple occasions in the past, and it worked out to my advantage when I needed a little help with some coding assignments. i need to include "parenthesis" in the equation in my program but i dont know … | |
since three days I try to insert many record in DB , I m using struts 2 and hibernate 3.I have 3 tables: 1 Evaluationglobale (id_eval ,label) 2 SousEval(id_eval ,SousItem_ID), 3 SousItems(SousItem_ID,label) my issue is how to insert many record in table SousEval when using the last insert id_eval in … | |
import java.util.Scanner; import java.text.DecimalFormat; public class Main { public static void main(String[] args) { double radius; double circ; double area; radius = getRadius(); circ = calcCirc(); area = calcArea(); DecimalFormat fmt = new DecimalFormat ("0.##"); System.out.println("run \n " + "The circumference of the circle is \n" + circ + "The … | |
Basically im practising java and came up on a challenge that i have yet to overcome. I have added an ActionListener but i want each button to have there own Action. Also what i wanted is to hide the contents in the button. Would be much appreciated to see how … | |
Alright ill apreciate some help, so here is the exercise and also what i have done so far. im a little bit lost on how to keep going. Problem Description: 1. Create Minimal Account Class for containment in the Bank container. 2. Define a Bank Class to hold Account Objects … | |
java program that uses abstract class,abstract methods and polymorphism to do calculations..?i need an idea of what i should be doing | |
Hi friends, i am using older version of hibernate jar files. I have little bit confusion between the older version and new version of jar files can you provide me the list of latest version of hibernate jar files thanks for your time | |
| |
Hi, Any Help, I need guide/way on how to get Image from JLabel and set it to JTextArea in netbeans when a button is clicked. I have 3 Object: (1) Jlabel(with an imported picture in it) (2) JTextArea(to store the picture when Button is clicked) (3)A button I tried using … | |
I would like to take an image file on disk and display it to fit the size of a jlabel (preserve aspect ratio) the image can vary in size from 100x100 to 1600x1200 and the size of the jlabel is 256x192 (can change it only slightly if need be.) I … | |
I have an input file with integers, I am obviously doing something wrong here, When I try to print the elements from the array, the integers are printing as 0's, and not even for the same amount. In the file there are 20 integers. mport java.io.*; import java.util.Scanner; import java.util.Arrays; … | |
Hi everyone, I am trying to write and application that will display a smiley face with a gray background and yellow face. This is what I have so far but it won't run. Can you please help me and show me how to get the application running? Thank you in … |
The End.