35,618 Topics

Member Avatar for
Member Avatar for Buffalo101

Hey guys, I'm trying to code a testing app which will display questions on a JForm for a period of time. I need a way of keeping track of time so I know when the user's time is up. What should I use? So far, I've found these: [B]javax.swing.Timer[/B] [B]java.util.Timer …

Member Avatar for Buffalo101
0
1K
Member Avatar for muncher10

i need to move[CODE]if(fright <= 45 && fright >= 35) System.out.println("Pressure is in range"); else System.out.println("Warning: Front right tire pressure is out of range"); [/CODE] to TirePressure but have it still print out right after i imput the tires pressure not after i imput them all and i cant figure …

Member Avatar for jon.kiparsky
0
89
Member Avatar for ivanhuk

For a homework assignment I need to make a stoplight cycle from red to green to yellow back to red. I tried using a thread.sleep method when I press a button to cycle through but it only goes to the last sleep & setColor statement. I know this is probably …

Member Avatar for JamesCherrill
0
164
Member Avatar for LianaN
Member Avatar for LianaN
0
117
Member Avatar for Barnifericus

Okay so in class my professor was going over this code: [CODE]class BinaryTreeNode<T> { protected T element; protected BinaryTreeNode <T> left, right; BinaryTreeNode (T obj) { element = obj; left = null; right = null; } // constructor BinaryTreeNode public int numChildren() { int children = 0; if (left != …

Member Avatar for sharathg.satya
0
253
Member Avatar for ARaza110

Here's the code : whichElement(e) [code]out.println("<li><a onclick='javascript:whichElement(e);menuClicked();selectMenu("+orders.get(i).toString().substring(43)+","+orders.get(i).toString().substring(39,40)+")'>"+orders.get(i).toString().substring(0,37)+"</a></li>");[/code]

0
60
Member Avatar for asif786

I have a compilation error using bluej java. Here is the code: [CODE]while input.equals(!"q")[/CODE] This is the error I get: '(' Could you please help me thanks :) If i add to a semicolon to the end like this: [CODE] while input.equals(!"q");[/CODE] I still get the same error.

Member Avatar for asif786
0
113
Member Avatar for proloy11

Hi, In a login.jsp page, I logged in by a user. Now by pressing the back button we can move to the login page also. If I log in this time by different user then old session getting reflected. How can I invalidate a session when we move to the …

Member Avatar for alex.antony.a
0
150
Member Avatar for javaperson1

Hi there, I tried to to delete sorted number in each rows by reading a text file and write it to another file with a new format: such as readfile1.text contains 1, thoman 2, tom 3, jess87 4, kelly and so on.. I came up with this code and I …

Member Avatar for javaAddict
0
152
Member Avatar for musikluver4

I have been able to successfully load another java program (Calculator) within a java program with the following code: [CODE]Calculator.main(null)[/CODE] The program loads successfully but both programs have the code: [CODE]addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } );[/CODE] So once I close the Calculator program …

Member Avatar for JamesCherrill
0
127
Member Avatar for fahadyousaf

Please any one guide me or give me some hint ... can i run my java application directly from batch file or any other way from which i can directly access GUI of application. Regards,

Member Avatar for apines
0
104
Member Avatar for blknmld69

I have started my code to create an application with two combo boxes. One that holds the names of the dormitories and the other holds the meal plans. The user should select a dormitory and a meal plan, and the application should show the total charges for the semester. I …

Member Avatar for jon.kiparsky
0
906
Member Avatar for musikluver4

I have a GUI program that controls all the graphics, etc of the program, while another program has all the calculations the GUI program grabs to show in its program. Well I would like to have another program that uses Frame and implements ActionListener, and launch that program with the …

Member Avatar for musikluver4
0
136
Member Avatar for hwalsh

Can anybody tell me why I'm not getting checkboxes? Sometimes I can get one, but never the three I need. [CODE]public class SwingLab implements ActionListener { // instance variables - this instance will get reader's name private Scanner reader;//name from user private Random random; private ArrayList<String> name;//construct a responder, declare …

Member Avatar for hwalsh
0
166
Member Avatar for sanju21

I have tried rs.wasNull() to check the null value from the database table..but it doesn't work.. pls let me show other ways to check null.. I consider the empty table when i request.

Member Avatar for toughlittleone
0
781
Member Avatar for Tankadin

Hi folks I know this particular program has been posted in many other forums but it all involves many different things that I have no learned yet so I really can't use any of them.....plus it would make me look stupid to turn in something that I copied that includes …

Member Avatar for Tankadin
0
5K
Member Avatar for sariberri

I'm trying to figure out how to add an element to an array of integers, but the tricky part is that I have to slide the elements to the right of it over by one place. For example: Start array: {1, 2, 3, 4, 5, 6, 7} Adding 10 to …

Member Avatar for Ezzaral
0
138
Member Avatar for sciprog1

Hello, I have a Client/Server program. The Server is BlackJackServer.java. I am having the following exception when I run the program. Can anyone explain me what the error below is saying? [CODE]java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.DataOutputStream.write(DataOutputStream.java:90) at java.io.DataOutputStream.writeUTF(DataOutputStream.java:384) …

Member Avatar for Ezzaral
0
171
Member Avatar for winner126

I'm trying to implement a chatroom using RMI and everything was fine until I tried to bring my GUI into the picture, from what I can see the RMI aspect is fine, the client is sending the info to the server, the server sends it to all clients with callback. …

Member Avatar for Ezzaral
0
358
Member Avatar for LianaN

Hello! I have a JScrollPane with JTable that is filled from MySQL. I'm using SwingWorker to display JScrollPane while reading data from MySQL database. There is no problem with it. My question is how to add a text "Loading..." to JScrollPanel? I just want to display some message in this …

Member Avatar for LianaN
0
4K
Member Avatar for falkor15

The problem states to write a method named fallingDistance that accepts an object's falling time as an argument. The method should return the distance that the object has fallen during the time interval. Demonstrate the method by calling it in a loop that passes the values 1-10 as arguments and …

Member Avatar for falkor15
0
670
Member Avatar for peter_budo

I have file that contains Unicode characters from Latin-1 and Latin Extended A sets (link to [URL="http://unicode.org/charts/"]Unicode charts[/URL]). How do I read it so that these unicodes are converted to proper characters? I tried [code=Java] public void readFile(File file) { try { BufferedReader in = new BufferedReader(new FileReader(file)); String noneUTF; …

Member Avatar for quuba
0
4K
Member Avatar for spades0001

I'm back guys! This time I'm working on this project for class. I have to make a "point of sale" thingy. I worked on it using GuiGenie. My design has four buttons, and I want to design it in such a way that when I click one of the four …

Member Avatar for winner126
0
152
Member Avatar for StaticX

Hi, I am having a terrible time getting to grips with layout managers, and am hoping someone can shed some light onto my misery.My problem is this: I have created a simple GUI, that contains a button panel, a picture panel and a radio button panel.All these panels are put …

Member Avatar for hanvyj
0
147
Member Avatar for sam1012

[B]my project in java is for blind people, basically it is a tutorial. i want some application in java which converts speech into text and text into speech, till now i dont know from where i can these applications. please suggest me in this way, i will be very thankful....[/B]

Member Avatar for hanvyj
0
45
Member Avatar for hanvyj

Hello everyone I am trying to print out a load of printables on different pages, I have made the containing class Pageable, and implemented all the methods as below, the acutal printing is done in printAllGraphs() : [CODE] PrinterJob printerJob; PageFormat pageFormat; int numberOfPages; public void printAllGraphs(){ //this.chart.print(); numberOfPages=this.dataList.size(); System.out.println("Number …

Member Avatar for hanvyj
0
187
Member Avatar for LianaN

Hi! My GUI consists of one main window and it takes 5 seconds before the this window is displayed (after pressing on the "Run" button in Eclipse). I want the window to be displayed at once even though it’s fetching tasks from the service. How could I do that and …

Member Avatar for Ezzaral
0
446
Member Avatar for Javarat

here is assignment create a book class with getter ans setters. create a driver class book_driver, and create an array or arraylist to hol at least four books. built the book class, built the book driver, having problem successfully building the array. I have not finshed the book driver; as …

Member Avatar for martin5211
0
271
Member Avatar for anilopo

how should i prevent the shallow copying? every class i think i would need to copy i need to do the 'clone' function? is there a 'copy constructor'? the thing is - i have a constructor that gets objects as parameters. how do i copy it into the data member? …

Member Avatar for apines
0
198
Member Avatar for neo_31591

[code] //package Answer; import java.sql.*; class Answercheck { public static String correct; public static String user="Brandon"; /* public static void check(int q1) { String dataSourceName = "questions"; String dbURL = "jdbc:odbc:" + dataSourceName; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection(dbURL, "",""); Statement s = con.createStatement(); s.execute("SELECT copt FROM Ques WHERE …

Member Avatar for neo_31591
0
122

The End.