32,199 Topics

Member Avatar for
Member Avatar for navinlearns

When i create a JTable like the code shown below: [ICODE][B]String[] columnNames = {"First Name", "Last Name", "Sport", "# of Years"}; Object[][] data = { {"", "", new Integer(5),""}, {"", "", new Integer(5),""}, {"", "", new Integer(5),""}, {"", "", new Integer(5),""}, {"", "", new Integer(5),""}, }; JTable table=new JTable(data,columnNames); table.doLayout() …

Member Avatar for Ezzaral
0
98
Member Avatar for Joncamp

The following code compiles, but I don't have any documentation on how to use the "enum" structure. I cant find any info on it in my books or Sun's language documentation... class Test { enum eone { Plus { int operate(int x) { return ++x;} }, Minus { int operate(int …

Member Avatar for stultuske
0
99
Member Avatar for BestJewSinceJC

I'm trying to read in the whole file at once. If this code ever fails, my whole project will fail. I'm using the following: byte[] theFile = new byte[input2.available()]; then, input2.read(theFile); The API says something about blocking. What exactly is blocking, when will it happen, and how will it affect …

Member Avatar for BestJewSinceJC
0
89
Member Avatar for Srinivas14

Hi can any one send me the code for receving sms through gateway using java program. first i want recevie the sms from mobile through gateway and the i want to send sms to mobile through gateway..plz send me the sample code to achieve this.. Thanks in advance..

Member Avatar for stephen84s
0
101
Member Avatar for PhiberOptik

I created a GUI. with a bunch of classes (that extended JPanel) and one that extends JFrame and now I can't figure out how to transfer data between them. lets say I have a public variable set in the JFrame class and a get method like the one below: [CODE=java]public …

Member Avatar for BestJewSinceJC
0
214
Member Avatar for star100

Two-dimensional Arrays. My question is based on this info did i code the right ? if not then let me know where did i made mistake? Input Data File here : 88 90 94 102 111 122 134 75 77 80 86 94 103 113 80 83 85 94 100 …

Member Avatar for BestJewSinceJC
0
111
Member Avatar for asameh99

I already added the path of my installed java, but the problem is I cannot compile my codes. here is my path. . %SystemRoot%\system32;%SystemRoot%;C:\Program Files\Java\jdk1.6.0_10 and then this is what happens when I compile. . Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Carlo>e: E:\>cd nerd's …

Member Avatar for verruckt24
0
125
Member Avatar for SmokyMo

Hi I have to make a program to parse html document and check for broken links. I did the first part and now wondering is there a method or class that checks if the link is valid?if not I assumed I can construst a method myself, like get the response …

Member Avatar for stultuske
0
147
Member Avatar for musham

i want the code in JAVA for the program [COLOR="Red"]"To find the shortest path using the fuzzy logic"[/COLOR]

Member Avatar for stultuske
-1
103
Member Avatar for neighbordave

I am having trouble getting output from this program. The objective of the program is to allow the user to enter 5 scores and then it is supposed to calculate the mean and rearrange the data set from highest to lowest. I am supposed to run it through the AverageDriver …

Member Avatar for javaAddict
0
258
Member Avatar for Kusno

I have this method : public void ExecuteSQL(String SQL) { Koneksi getCn = new Koneksi(); Connection cnExecute = null; try { cnExecute = getCn.getConnection(); int rowNgefek = 0; Statement stExecute = cnExecute.createStatement(); cnExecute.setAutoCommit(true); stExecute.executeUpdate(SQL, rowNgefek); cnExecute.commit(); closingConnection (cnExecute,stExecute); } catch (SQLException e) { System.out.println(e.toString()); } } If insert/delete/update raise error, …

Member Avatar for stephen84s
0
187
Member Avatar for eng.M4AH

Alsalamu Alikum, So, It's my first time to study and work on recursion functions, and it was said in the lecture that it is better than the iterative function because [QUOTE]they are shorter, more elegant, more readable, naturally developing and it's code is easier to understand.It comes with more cost …

Member Avatar for mahlerfive
0
130
Member Avatar for PhiberOptik

Hey folks, I am working on a getBalance method that retrieves a balance from a CSV file. I keep getting: [ICODE][COLOR="Red"]java.lang.NullPointerException at java.util.StringTokenizer.<init>(StringTokenizer.java:182) at java.util.StringTokenizer.<init>(StringTokenizer.java:204) at atmEngine.getBalance(atmEngine.java:100) at atmEngine.<init>(atmEngine.java:81) at Launcher.main(Launcher.java:12)[/COLOR] [/ICODE] I can't figure this one out! I threw in some console print outs to make sure it was …

Member Avatar for PhiberOptik
0
1K
Member Avatar for PhiberOptik

Hey guys, I am working on my final project, and I was wondering, I am designing the GUI and if you look at the buttons I want the green and red buttons to appear 3D like the rest of them but with a colour overlay is it possible to do …

Member Avatar for PhiberOptik
0
270
Member Avatar for clueless101

[quote] My code asks a user for a password. To properly validate the user's entry, it must include the following requirements: 1)have a length of 5 2)have an uppercase character 3)have a lowercase character 4)have a digit My loop only works for the lowercase and length of 5 requirements. Can …

Member Avatar for clueless101
0
127
Member Avatar for Grub

Hi is there a way of getting a file creation Date for a file class object? I am trying to do so on a mac. Many thanks

Member Avatar for Grub
0
314
Member Avatar for mrjoli021

I have a tab delimilated txt file. how can i read only the second part of the file. ex 10.0.0.0 hostname date i want to read in the hostname only what function can i use to do this?

Member Avatar for Ezzaral
0
100
Member Avatar for VernonDozier

OK, I've been reading a lot online and I think I can't do this, but I'm really hoping someone has a clever workaround. What I have is a bunch of classes with Color attributes. I'm also storing the red, green, blue, alpha values as integer attributes in those classes because …

Member Avatar for VernonDozier
0
141
Member Avatar for star100

Student database creating a program that will be used to manipulate a student database. This portion of the database will keep track of student data to include the students name(first, middle, last), date-of-birth, the student's id number, the student's major, and the student's GPA.Based arrays and objects,use 2 parallel arrays …

Member Avatar for VernonDozier
0
188
Member Avatar for star100

How can i code in java using Two-dimensional Arrays Method to input data from the data file Method to display the table (Please align columns, but no need to use borders, line separators, etc.) Method to compute the average of each row and display it Method to compute the average …

Member Avatar for Ezzaral
0
115
Member Avatar for leox99

we would like to build a system in java ( set of classes ) to manage and handle text files . the required software uses the predefined java streams (FileReader, FileWriter,...) and allows creating and opening of new text files as well as writing and reading.In plus, it allows the …

Member Avatar for stultuske
0
92
Member Avatar for TAboy24

I had to write a triangle code enabeling it make some functions and including constructors inside..based on using the class Point(i atached the description file of it here and the Point.class itself)..I can't write the " public static void main () " in my code cause it screams errors to …

Member Avatar for Ezzaral
0
205
Member Avatar for babusek

Hii Folks , Sorry For this Long Question, Problem: I Want to Create 5 check boxes and i want to reorder those components using a GridBagLayout , and it's have a Container called Local_Container,after reordering of those components add to panel, so Now we have a Container(Local_Container with a label …

Member Avatar for babusek
0
153
Member Avatar for babusek

HI Folks , Any one Here Name The Java Swing Component with "Date and Time Instance"? Thankq Sekhar

Member Avatar for masijade
0
149
Member Avatar for pavanwanam

Sliding Window Mechanism The sliding window mechanism is used in many protocols at many different layers. The sliding window helps in solving a number of problems. Retransmission of lost or damaged frames (or packets) and flow control problems are just examples of that. The sliding window protocol in its simplest …

Member Avatar for verruckt24
0
114
Member Avatar for vlpkiranmayi

i am persuing my engineering.i would like to do a mini project in java.can anyone please suggest some interesting topics and guide me how to start??

Member Avatar for stultuske
0
349
Member Avatar for jbennet

Okay im reading in lines of text e.g "abcdefg" and I need to split the line into an array of characters where each character is stored in its own element so its like [a][b][c][d][e][f][g] I know how to do it with splitting words from poems etc... using something like txtLine.split(" …

Member Avatar for ~s.o.s~
0
139
Member Avatar for nyalex

Hi I am working on an incredible project, it is an GUI. I hav used a JLabel to show 10 words but it actually always shows the last one only. I think that i need a timer to make it change but i have already a timer and i cannot …

Member Avatar for nyalex
0
294
Member Avatar for BestJewSinceJC

[CODE]public void generateBits(Node root, int current, int counter){ if (root== null) return; if (root.left == null && root.right == null){ list.add(new HuffCode(root.theChar, current, counter)); } else{ current<<= 1; //move all the bits 1 spot to the left generateBits(root.left, current, counter+1); generateBits(root.right, (current | 1), counter+1); } }[/CODE] Somehow, this method …

Member Avatar for BestJewSinceJC
0
97
Member Avatar for Blackeagle

Hi, i' having a small problem with panels. i want the panel always to have the same size even when empty. in my program that i'm writting, i can see that the panel doesnt fit all the area where i put it ( i noticed that as i have different …

Member Avatar for Ezzaral
0
156

The End.