32,204 Topics
| |
Why is there so many questions in this forum on really simple gui problems that can easly be solved by using an IDE such as netbeans and creating the gui from there .... I mean thats what is there for why still use the old way? beacuse you like to … | |
Hello; Well, I need to create a program that randomly inserts new different sized spheres into a swing panel and animates them [movement is delimited by the width and height of the frame - when they collide with the frame they bounce to a random direction]. How could I accomplish … | |
WHY DO I GET ERRORS FOR loadTicket MEthod saying incompatiable type, please someone tell me whats wrong and tell me the correction for it? import java.util.Date; import java.lang.*; import java.io.*; import java.util.Calendar; public class Ticket { public TicketInfo x; public int tNumber; public static long entranceTime; public static long paymentTime; … | |
Hey everyone, I'm just wondering what level and type of maths are needed in solving programming problems. I was looking at maths courses the other day but I was unsure which one would suit my need as I'm an IT guy. Can anyone suggest something? I want to be able … | |
[CODE]class thr2 { public static void main(String args[]) { A a = new A("first","hello1"); A a1= new A("second","hello2"); try{ a.t.join(); a1.t.join(); }catch(Exception e) { } } } class A implements Runnable { Thread t; String str; B b = new B(); A(String name,String str) { t=new Thread(this,name); t.setName(name); this.str=str; t.start(); … | |
//Payroll Program Part 2 package payrollprogrampart2; /** * * @author Zach */ import java.util.Scanner; public class PayrollProgramPart2 { public static void main(String args []) { System.out.println("Welcome to Zach's Payroll Program"); Scanner input = new Scanner( System.in ); String employeeName; System.out.print("What is the employee's name?"); boolean stop = false; while (!stop) … | |
where i can but the servlet APIs ? to compile java class from bat file | |
[CODE]class Newthread implements Runnable{ String name; Thread t; Newthread (String threadname) { name=threadname; t=new Thread(this,name); System.out.println(t); t.start(); } public void run() { try { for(int i=5;i>0;i--) { System.out.println(i); Thread.sleep(1000); } }catch(--------){ --------} } } class A{ public static void main(){ new Newthread("one"); new Newthread("two"); new Newthread("three"); try{ Thread.sleep(10000); }catch(){} } … | |
Hello, I've had a good search to see if anything else was posted in relevance with this, but can't find anything that suits my exact needs. I've been given a Java assignment to take in a file, and read how many characters it has (omitting white-space and new lines) and … | |
Hey everyone, I was doing an exercise from Java book and I didn't get how this code works.. I know how the switch statement works. However, I don't understand why they pass a number to the Random class and also to the .nextInt() method on rand. And also, I am … | |
Hi everyone, Could anyone please tell me why that line in the if-statement body is breaking the method? [CODE] static int [] doubleMe(int [] list){ int [] y= list; int c = 0; int [] w; for (int i= 0; i < list.length; i++){ c = list[i]; if (c % … | |
Hy , I have a table , in which i am adding new rows , after 6 rows with data I want to add a empty row with the background color red then another 6 rows with white background [CODE]private void populate(){ DefaultTableModel model = (DefaultTableModel) table.getModel(); int i,j; for(j=0;j<6;j++){ … | |
I'm in an intro programming class and have a problem. Hoping someone can assist me. What I'm trying to do is import a data file and have it read the array in reverse order. That part I have. The second thing I'm trying to do is have it total the … | |
Making an airplane seating map and the code does not break after the number 88 is selected and does not print our the array, any help? Thanks [CODE]import java.util.*; import java.util.Scanner; public class AirplaneSeats { public static void main(String[] args) { char[][] seats = new char[13][4]; char filledseat = 'x'; … | |
Hi, I it possible to implement an ActionListener to a global or local variable so that if variable changes the Listener performed a certain function / method etc.. I am working on a GUI application i am guessing there has to be a better solution than wrapping my main code … | |
Here is my code... [CODE]import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; public class example1{ public static void main(String[] args) { try { Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","user","password"); Statement state = (Statement) con.createStatement(); String username = "John"; String password = "John1"; int experience = 0; int level = 1; String insert = "INSERT … | |
pls help me with this the user enters a number n.consider the sequence from 1 through n in ascending order.insert either '+' or'-' between each of the digits so that the resultant sum is zero. for eg: input=7 output= 1+2-3+4-5-6+7=0 1+2-3-4+5+6-7=0 1-2+3+4-5+6-7=0 1-2-3-4-5+6+7=0 however when i programmed it i only … | |
am able to draw different programs on swings using mouse drag.but if i draw one diagram the previous diagram is getting vanished. how to avoid that ? i want to have all the drawn diagrams on the screen [CODE]import java.util.*; import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.awt.Graphics; class draw1 … | |
Hi, I'm doing a project with java using the console and I'd like to perform some actions (such as printing to the screen etc) while waiting for input. I was planning to accomplish this by using unbuffered input, by polling the keyboard and performing other actions alternatively, but apparently retrieving … | |
Hi, Am finding 1 diffculty in jtable pls help me... i want to set jtextfield value in jtable of particular column and also that jtextfield value will be dynamically changing... even i have tried the below code... [code]String mn=jTextField2.getText(); jTable3.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(mn));[/code] but its not working... | |
hi, my problem is that : let i m declaring a package P1 and i have defined one class as public in it.now i know that i can use it anywhere. but let if i want to make a second class as public then it can not be possible.but if … | |
Hi there, It's been a long time since I've used delimiters in the Scanner class in Java. If I wanted to have any numbers between an expression, such as xx/xx/xxxx or an infinite amount of numbers between them with just the forward slashes as delimiters, what would the syntax be? … | |
Guys I don't know the output of the following loop please help me out [CODE]for ( int = 10; i > 0; i--) { system.out.println ( i*2); } [/CODE] and one more: [CODE]while( a < 20 ) { a += 3; System.out.println( a ); }[/CODE] Thanks! | |
Could someone please tell me why is my JScrollPane not aligning together with my JLabel of description? I want my label "Description:" to be right next to my JScrollPane which contains a JEditorPane. [CODE]import java.awt.FlowLayout; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.SplashScreen; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import … | |
[CODE]public class DoubleArray { static Console c; // The output console static final int total = 20; String[] numStr = new String [total]; static double numDbl; static String stop = ""; public void getAndStoreInput () { int count = 0; do { c.print ("Enter number" + (count + 1)); c.print … | |
I am attempting to complete an assignment but an having some major issues as my java knowledge is basic to say the least. Below is what I am trying to do and below that is the current code that I have. Am I way off base or on the right … | |
Hello there I have been given an assignment at Uni to write program (obviously thus im here hehe) The user (customer wishing to purchase a computer) should be able to login by typing his user name and password and pressing the “Login” button. The layout of this first screen of … | |
So the program seems simple enough but for some reason when I compile it in the windows command prompt, I get an error that reads "error, cannot find symbol and it point to the period between the list.add(); Any ideas what I'm doing wrong? Thanks! [CODE]// NOTE: THERE ARE FOUR … | |
So I'm having trouble parsing a double... Here's my code: [CODE]public class DoubleArray { static Console c; // The output console static final int total = 20; String[] numStr = new String [total]; Double numDouble; public void getAndStoreInput () { int count = 0; do { c.print ("Enter Double" + … | |
the question im doing is: write a java program that allows the user to enter a set of numbers and then displays the sum and the average of the values. It should begin by asking the user how many values they will enter. you should use two seperate methods to … |
The End.