32,199 Topics

Member Avatar for
Member Avatar for murali2489

Hi All, I have written an application for traffic Study which takes traffic load for seven days, inputting traffic load during morning,lunch,evening and night for each day. The output im getting is this Morning Lunch Evening Night Average Day 0 : 5 5 5 5 5 Day 1 : 5 …

Member Avatar for JamesCherrill
0
256
Member Avatar for DarrelMan

I get an unknown source error when I try to use the Scanner class. fabric is the name of my Scanner ojbect. while(fabric.hasNext()) { fabricID[fabricCounter] = fabric.nextInt(); name[fabricCounter] = fabric.next(); description[fabricCounter] = fabric.next(); price[fabricCounter] = fabric.nextDouble(); qty[fabricCounter] = fabric.nextInt(); vendor[fabricCounter] = fabric.next(); fabricCounter++; System.out.println("made it down here"); }//end while fabric.close(); …

Member Avatar for JamesCherrill
0
300
Member Avatar for Shanti C

Hi All, Im generating some output files(kind of reports) in my reportGenerator class.Acutally im creating then into hard disk and showing them in browser. But i want this scenario to be developed into my project : Want to return the generated file as stream to another class, and show that …

Member Avatar for JamesCherrill
0
142
Member Avatar for Azad Omer

We all use `this` keyword many times explisit with our instance fields or constructor, however, this refers to* current object*, for example: class Foo imlements ActionListener{ Foo fooObject; public Foo(){ //.... button.addActionListener(this);//this work as we pass the current object reference as an argument //or button.addActionListener(fooObject);// this will compile, but the …

Member Avatar for stultuske
0
286
Member Avatar for mikewyatt

Help! application is rapidly degrading..... I have had problems with netbeans being able to keep subprojects incorporated with the main projects (loaded into tabs). Usually solved by recompiling the missing .java file, doing a clean build and they load back in. Now I have the error, component cannot be intantiated.... …

Member Avatar for mikewyatt
0
247
Member Avatar for Deve

**I want to enter the value in jtable run time and want to dispaly its sum on same jtable when i pressed calculated button ** how to do please help :) import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.*; import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; import …

Member Avatar for Deve
1
2K
Member Avatar for cisumma

Hello, I have an app that runs good in the NETBEANS ide. When I run it as a stanalone exec.jar and place the executable in the project folder or when I place the executable on the thumb drive it runs with anomolies. When I run the app from a thumb …

Member Avatar for cisumma
0
186
Member Avatar for TokamakFusion

A student of mine wrote the following code: public class Counter{ private num = 0; public void inc(){ num = num++; } } which fails to increment. Why? If num starts at 0, then the assignment should be num = 0 then num should increment during the postfix incrementation of …

Member Avatar for bibiki
-2
458
Member Avatar for london-G

Hello, I have a textfield price. The user has to input a price(currency) into it. I would like to do something so that when the user types in a curreny it will automatically add the commas and the zero when needed. If the user was to type in 1000000 it …

Member Avatar for JamesCherrill
0
2K
Member Avatar for KellzDD

I need help with some methods in my constructor class. My first method receives scores, computes test totals, stores them in an array and returns them. public int[] computeStudentTotals (int[][] scores) { } My next method computes grades. It invokes the computeStudentTotals method to compute the totals of three tests …

Member Avatar for stultuske
0
243
Member Avatar for DarkLightning7

Ok so im working on a mapping library for my pathfinding system and im trying to figure out what Data structure would be best to use for rapid calls up to several hundred a second, as low memory usage as possible, and not too difficult to store and load pieces(chunks) …

Member Avatar for DarkLightning7
0
203
Member Avatar for Shizuo

Heres my code [CODE]import java.applet.Applet; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Order extends Applet implements ActionListener { String password = "pword"; TextField txt1 = new TextField(10); TextField txt2 = new TextField(10); Button btn1 = new Button("Ok"); Button btn2 = new Button("Ok"); Label lbl1 = new Label("Choose Your Order"); …

Member Avatar for JamesCherrill
0
451
Member Avatar for bibiki

hey there, in a project I am involved, someone put a test class in main code. eclipse would not find the bug but mvn, not that in eclipse, would report a compile error, and we found the bug. because of that, I wanted to build my new maven project without …

Member Avatar for peter_budo
0
170
Member Avatar for untio

Hi, First, thanks for reading this stuff. I am learning java. I recognize that I am a beginner. Last weekend I have coded a clock. Sourcecode is: import javax.swing.JFrame; import java.util.GregorianCalendar; import java.awt.image.BufferedImage; import java.awt.Canvas; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Color; import java.util.TimerTask; import java.util.Timer; import java.awt.BasicStroke; public …

Member Avatar for untio
0
213
Member Avatar for fmasroor

How can I get the mouse position even when an event hasn't been performed, eg. I haven't clicked or left window, etc. Kind of like mousing over something. I am currently using a class that implements MouseListener, MouseMotionListener for events such as clicking and releasing but I would like a …

Member Avatar for JamesCherrill
0
206
Member Avatar for CrAzY347

First thing i want to say is i am sorry if this is not the appropriate place to post this. I am basically looking for an open source project to work on. I honestly have no idea how to find one or how to become a part of one. I …

Member Avatar for pritaeas
0
199
Member Avatar for mesbahuk

For my **Java to C#** conversion project, I need to use something equivalent to Java's `Calender` class. I have some codes like: Calender cal = Calender.getInstance(); long time = Calendar.getInstance().getTime().getTime(); long time2 = System.currentTimeMillis(); which returns some random values at different times. I have come to know C-sharp's `DateTime` is …

Member Avatar for ddanbe
0
981
Member Avatar for murali2489

Hi All, Im still finding it hard to understand Paint method, Almost all websites i had gone thru, they are showing examples of how to use it in an applet. I just cant understand on how to use it in a GUI application by extending Jframe object. Here is one …

Member Avatar for murali2489
0
1K
Member Avatar for pmark019
Member Avatar for Ne0nx3r0
0
751
Member Avatar for vinnitro

This is my ScreenManager class which is used for getting the perfect DisplayMode & setting the screen to fullscreen import java.awt.*; import java.awt.image.BufferStrategy; import java.awt.image.BufferedImage; import java.lang.reflect.InvocationTargetException; import javax.swing.JFrame; public class ScreenManager { private GraphicsDevice vc; //give vc access to monitor screen public ScreenManager() { GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); vc …

Member Avatar for vinnitro
0
280
Member Avatar for <M/>

I have a project and I don't understand what the instructions want me to do. Can someone explain them better...? I don't understand constructors, objects, and methods very well but I am trying my best to do this project (i am a bit amazed how i got the highest grade …

Member Avatar for rubberman
1
308
Member Avatar for newbie14

Hi All,We have a java application which does deal with lots of insert,update and select statement.We are using bonecp. So we took some sample heap and analyse it with MAT and its pointing to jdbc leaking. Thus we went into the codes and ensure that all resultset,statement and connection are …

Member Avatar for newbie14
0
936
Member Avatar for mikewyatt

I have a jtable and inside this table is a column of checkboxes (other info on following columns). if the user clicks on the checkbox to change it, which it does, there is a popup that comes up for an administers password approval... got that. If the approval is accepted, …

Member Avatar for ageshyaw
0
2K
Member Avatar for christine.dunne.963

I tried using BorderLayout as in label but does not work package HelloWorldGUI; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class HelloWorldGui { private JFrame a; private JPanel p; private JButton b1; private JLabel lab; public HelloWorldGui() { gui(); } public void gui() { a = new JFrame("window"); a.setVisible(true); a.setSize …

Member Avatar for scudzilla
0
124
Member Avatar for murali2489

Hi All, I have a doubt in paint method of the Component Class. I know how to use that in Applet but im finding it hard to use it in GUI app. Im posting my code here, please edit it to make the program use paint method to render any …

Member Avatar for JamesCherrill
0
330
Member Avatar for JoeD1

I created a String[][] grades, who's size is set by number of students User enters. The array is then populated with my first for loop, and the next for loop is supposed to print out each students date line by line. If I only enter 1 Student and fill in …

Member Avatar for stultuske
0
279
Member Avatar for murali2489

Hi All, I have created a Java applet in Eclipse and ran it in eclipse, it works fine . To run the applet in Webbrowser it was mentioned to embed the .class file inside a webpage by creating a HTML file. My class name is MyFirstGUI. i have created a …

Member Avatar for murali2489
0
278
Member Avatar for yusking

Using an SQLite database your program should be able to create, read, update, and delete room reservations. Present the user with a menu at the beginning using the console or JOptionPane for example: Choose a task 1. Add a reservation 2. View a reservation 3. List all reservations 4. Update …

Member Avatar for stultuske
-2
2K
Member Avatar for gauravagg2

HI!!!! i am a student of B.Tech 3rd year plz suggest me a mini project in java i have basic knowledge of swing and jdbc and elementary idea of networking

Member Avatar for JamesCherrill
0
539
Member Avatar for mrosario

hi guys, i'm really having a trouble with my conversion code... it says the NumberFormatException with this "Student[] studs = new Student[Integer.parseInt(fr.nextLine())];" but i have no idea why. can someone help me? import java.util.Scanner; import java.io.*; public class SampleFileProcessing implements Serializable{ private static Scanner fr; public static void main(String[] args) …

Member Avatar for mrosario
0
2K

The End.