32,204 Topics
| |
[CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.sql.*; class transfer extends JFrame implements ActionListener { JButton btntrans,btndel,btnexit,btnclear,btnone; ImageIcon bc; JLabel lbltitle ,label1; JTextField text1; JScrollPane scrollPane ; Thread t; DefaultListModel listModel; public transfer() { setSize(550,400); setTitle(" FILE TRANSFER "); Container cp=getContentPane(); lbltitle= new JLabel(bc); label1 = new JLabel(); … | |
public class Connect4Model { Connect4Column [] columns; // Cannot find symbol private int NUM_COLUMNS; private int NUM_ROWS; private int playerToGoNext = Connect4Column.RED_COUNTER; // cannot find symbol Connect4Model(int numCols, int numRows); // Missing method body...Is this because I'm missing a curly braces just above { columns = new Connect4Column[NUM_COLUMNS]; for (int … | |
To be honest...I am horrible at java. I just got a job and have missed class a few times because of it and im supposed to create a project that can read the number of lines, words, characters, average words length, and letters in a file. I am trying to … | |
Hello, Can anyone tell me how to get records from SQL server database in j2me. As I want my application to run on Low-configuration device, I cant use servlets. Also help me on writing and reading objects in a file using j2me? Thank you! | |
Hi i was wondering if it was possible, in java, to save a session/state of an application and then reloading the data (all automatically)when re-opening?? I have a GUI with some textarea, a jtree with filesystem hierarchy and a jpanel with buttons. I can create many buttons and within these … | |
I've just started programming, and I'm taking a java class as one of my electives this year. We have a program due tomorrow and I'm very much lost. I think i know what I want to do, but I don't understand the concept or know enough code to get everything … | |
Can anyone tell me if we can set uneven interval for range axis in JFreechart? If yes hw can I do that? Actually I want the scaling to be something like 0,10,20[B],30,35,40,45 [/B]50,60,70,80 .. Thats in the beginning and at the end the scale interval is 10,but in the midrange … | |
Hi all, Does anyone know of a way to scan a character from the command line without the enter key having to be pressed? For example, the user would type 'a', which is then picked up and scanned by the program and stored, etc. The only way of scanning input … | |
Hi, I'm currently in a the process of making a connect4 game, but what is highly frustrating is that im trying to write a loop that takes i from 0 up to the NUM_COLUMNS. and then make the new object called Connect4Column. When I compile and run this it gives … | |
My program is used to perform a salami attack on the database Whenever i run the program the compiler display the following message Invalid Cursor state on line 29 [CODE]import java.sql.*; //import java.io.*; class SalamiAttack { String ssql1,ssql2,usql,temp="",buffer=""; Connection conn; Statement st; ResultSet rs1; int index=0; float tempfraud,fraud,zigacc=0; SalamiAttack() { … | |
I'm new to java, so please be kind if I'm not making any sense or making a rookie mistake! But I have been working for HOURS trying to figure out where I'm going wrong to no avail. I'm pretty sure I'm just missing something really simple, but hopefully someone here … | |
plese help..what is the poblem about this codes?\ [CODE] public abstract class Employee{ private String firstName; private String lastName; private String socialSecurityNumber; public Employee(String first, String last, String ssn){ firstName=first; lastName=last; socialSecurityNumber=ssn; } public void setFirstName(String first){ firstName=first; } public String getFirstName(){ return firstName; } public void setLastName(String last){ lastName=last; … | |
Hi all, FYI im really new in Java.last time my project was in C but suddenly my supervisor changed to Java.i got the code from him (see below).wanna ask u guys how to learn Java and these means? Lastly, how to create dropdown menu? [CODE] import java.awt.Color; import java.awt.Container; import … | |
it works but instead of it reverseing the characters i want it to do this "This is a test.” should be reversed to read: “test. a is This” i want it to do all this in a text file [code]import java.io.*; import java.util.*; public class reverse{ public static void main(String[] … | |
Hey guys and gals. Like I said in my last post I am in college. Well I wrote a program and a friend who majored in computer science said that my program will work... Well it does but doesnt do like I want. I am in need of advice using … | |
Hi all, I'm currently developing a java program that executes XPath 2.0 statements using the library Saxon. I have i problem doing some operations with dates. I'm using this XML for testing purposes. As you can see the dates are in format 'YYYYMMDD', i need to retrieve the latest one … | |
please help me about this program...i dont how to sort the even numbers inputted. [CODE]import java.io.*; import java.util.*; public class mp5{ public static void main(String[ ]args) throws IOException{ BufferedReader br=new BufferedReader (new InputStreamReader (System.in)) ; int num=0,sum=0; String snum; System.out.print ("Enter size of Array: "); snum=br.readLine( ); num=Integer. parseInt( snum); … | |
Hi everyone, I am new to Java and more recently Swing. I was wondering if anyone would be able to show me a way of inputting a value into a text box, and being able to use this to calculate a sum for example. Also I am interested to know … | |
Can someone help me with error trapping. For instance, if I asked the user to input only a numeric type, 0-9. Then how would I go about creating an error message if the user inputs "hey." I know that I could easily use the Try, Catch statements but I want … | |
Hello Everyone, I am trying to extract integer values from 2 int variables i have created in my database table "mytab". The data or table values i have extracted on console and its working fine. But i want to use the values as x,y coordinate for my label i have … | |
Here is the thing. This code segment is supposed to add the Subject Codes for Student each time I change the Student ID from [I]jcmbDIT [/I]combo box. Initialization works well. and after I handled [I]NullPointerException[/I] subject codes are loaded into the [I]jcmbSubCode[/I] combo box correctly. [CODE]private void jcmbDITActionPerformed(java.awt.event.ActionEvent evt) { … | |
I have to use a queue in an solitaire assignment, but I'm having some trouble using the linked list Queue class that I made. It won't take arrays at all. [code] class Testing { public static void main (String [] args) { Queue testlist = new Queue(); // testing Queue … | |
class Employee { private String last; private String first; private String title; private int age; static int count = 2; public Employee() {++count;} public Employee(String last, String first, String title, int age) { this.last = last; this.first = first; this.title = title; this.age = age; } public String getLast() { … | |
Hey, I'm having problems with JTextPane, I have class which has gui and other class for the software logic (in this case text editor), so when I try to save a file using filechooser it works fine to the point where it needs to save the information from the JTextPane, … | |
[COLOR="Red"] This is my assignment: [/COLOR] The field of calculus is largely concerned with the concepts of the derivative and the integral of functions. Derivatives and integrals are closely related because they "undo" or reverse one another. If the derivative of a function is taken, a new function is obtained … | |
[CODE]import java.util.Scanner; public class ticTacToe { public static char[][] board = new char[3][3]; public static getMove(int turnNumber) { char choice = ' '; if (turnNumber % 2 == 1) { //x's turn System.out.println("X's Turn."); char choice = 'x'; System.out.println("Which row and column would you like to choose? (enter number for … | |
Hi, I am new in Spring. While trying to create aspect using AspectJ annotation, I am getting following error. My configuration file is as follows: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans [url]http://www.springframework.org/schema/beans/spring-beans-2.0.xsd[/url] [url]http://www.springframework.org/schema/aop[/url] http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <bean id="audience" class="src.com.spring.Audience"/> <bean id="steve" class="src.com.spring.Juggler"> <property name="beanBags"> <list> <value> "1" </value> <value> "3" </value> </list> </property> … | |
Hi there, I am making a mail notifier application, runnable JAR, which has a file in which i save the settings like username, password, etc. I wonder if i can save them inside the JAR itself with no external file. | |
I'm trying to get live feed for my server from this page [URL="http://dkm.inx-gaming.co.uk/stats/server.php"]http://dkm.inx-gaming.co.uk/stats/server.php[/URL]. As you can see, when it first loads, it says "Querying Server x, Please wait.." for a fraction of a second.. And that's what the [B]openConnection[/B] function returns, too. Is there any way I can tell it … | |
Hi, In one of my vb.net 2008 application i have called a java class file through batch process which creates txt file and jar file and put in app path folder. When i run the application it creates only txt file in the app path and not the jar file. … |
The End.