35,618 Topics
![]() | |
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 … | |
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 … | |
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 … | |
Hi! Does anybody know how to group JLabel and JTextField in order to get a single component? Thanks! | |
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 != … | |
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] | |
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. | |
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 … | |
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 … | |
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 … | |
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, | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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) … | |
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. … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
[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] | |
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 … | |
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 … | |
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 … | |
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? … | |
[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 … |
The End.