32,207 Topics

Member Avatar for
Member Avatar for asian_al

Should would i turn the following code: [CODE] import java.awt.*; import java.io.*; import java.util.StringTokenizer; public class ex74 { public static void main(String[] args) throws IOException { Frame f = new Fram(); String sent; StringTokenizer st; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter a sentence: "); sent = br.readLine(); sent = …

Member Avatar for kvprajapati
0
91
Member Avatar for custurd12

A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units …

Member Avatar for BestJewSinceJC
0
1K
Member Avatar for taruj83

Hi, I want to create a web application that will let a user enter name in a text field and the application creates a newtab with datafields for that user to enter, it all must happen on a single page. There has to be one tab for each specific name …

Member Avatar for BestJewSinceJC
0
109
Member Avatar for BestJewSinceJC

Is using (in the paint method) g.clearRect() the correct way to clear the screen? It's working but I don't know if there is a better way. . google says it is supposed to clear automatically when update is called but that doesn't seem to happen.

Member Avatar for BestJewSinceJC
0
136
Member Avatar for Zima77

I am working on a project that involves creating a Vehicle class which has 3 data fields, one of which is an instance of a class rather than a fundamental data type ([I]owner[/I] is an instance of the class [I]Person[/I]). This class has multiple constructors for the varying initial values. …

Member Avatar for Zibo
0
416
Member Avatar for rwagnes

I have an nis server running on solaris. I am using the list function in the DirContext java class to discover the hosts. For example: ctx.list("host") returns the hosts in the hosts file. The problem is, there are also hosts in the ipnodes file.. How do I discover those hosts? …

Member Avatar for rwagnes
0
100
Member Avatar for Zibo

Hello. I've got such example statement: [code=Java]for( int i=0; i <= 10000; i++ ) myTextArea.setText( myTextArea.getText()+ i + "\n");[/code] What is the problem? I can't figure it out, why in every iteration of loop the text area isn't refreshing with new String added. When this loop is iterating, app freezes …

Member Avatar for Zibo
0
129
Member Avatar for hypernova

I am doing B.Tech in computer science and I am in the 1st year (I have almost completed 1st year) I want to learn a language in the forthcoming summer break (2 months) between the first year and second year, and am quite confused if I should go for [U]C++ …

Member Avatar for Narue
0
144
Member Avatar for K?!

Hi all Is it possible to use only the classes you need in a panel or something? I'm finding it hard to explain my question, i'll give an example: We need to make a program to organise swimming competitions. When you want to (as a user) edit or create a …

Member Avatar for peter_budo
0
117
Member Avatar for whex

Working on a current project with these parameters and am not sure where to start. I am new to all of this and could use some input. Use JAVA to build a sales commission application. In this application, the user enters a number in the SALES JoptionPane textbox. When the …

Member Avatar for masijade
0
102
Member Avatar for marco01

I'm working on a code to calculate a final score. Here below is my code: [code] public void calcFinalOCAS() { int calcFinalOCAS; int sum = 0; List<Integer> tmaMarks = new ArrayList<Integer>(); Collections.sort(tmaMarks); int minMarks = Collections.min(tmaMarks); if(minMarks < substitutionScore) { minMarks = substitutionScore; } for (int i = 0; i …

Member Avatar for marco01
0
83
Member Avatar for cebubinary

hi..i was wondering where to find a sample java code that splits an image and each image that was splitted can be click and link to another image...

Member Avatar for kvprajapati
0
55
Member Avatar for BestJewSinceJC

I have a list of teams, it can be any length. Now, for each team, I want to create a 2D box that says the team's name in the box. And I want to match these teams up against each other. So basically I want to be able to drag …

Member Avatar for BestJewSinceJC
0
158
Member Avatar for MrDiaz

Hi, How can I code it so I can make a new window appear on my application? Let's say, user hits a "new user" button, a new window is supposed to pop with TextFields and labels and so on. In Dephi is something like, Form1.show; How do I do this …

Member Avatar for MrDiaz
0
75
Member Avatar for kingarabian

[CODE]public static RSString method50(byte i, int i_0_) { if (i > -36) anInt63 = -44; anInt55++; if (i_0_ < 100000) return (Class68_Sub20_Sub13_Sub2.method1166 (2, new RSString[] { Class85.aRSString_1556, Class68_Sub13_Sub24.method816(i_0_, 0), Class96.aRSString_1697 })); if (i_0_ < 10000000) return (Class68_Sub20_Sub13_Sub2.method1166 (2, (new RSString[] { Class21_Sub1.aRSString_2695, Class68_Sub13_Sub24.method816(i_0_ / 1000, 0), Class68_Sub13_Sub11.aRSString_3611, Class96.aRSString_1697 }))); return …

Member Avatar for kingarabian
0
124
Member Avatar for metalheart2003

Hello, I am doing an upload of my applet has my website, I works very well but I do not like putting a bar of Progress! (JPROGRESSBAR)! CAN PLEASE HELP ME! UPLOAD MY CODE! String targetURL = "http://localhost/swfupload/demos/swfobjectdemo/upload. aspx"; PostMethod filePost = new PostMethod(targetURL); filePost.getParams().setBooleanParameter(HttpMethodParams.US E_EXPECT_CONTINUE,true); try { File targetFile …

Member Avatar for metalheart2003
0
105
Member Avatar for panda_pow

I'm writing a program that determines the population of the world between years 1975 to 2006. I found an equation for the world pop and i put it in my code, but i keep getting a '.class' expected. Can anyone help??? --Cassie P.S: The error is where pop is defined. …

Member Avatar for panda_pow
0
109
Member Avatar for pyscho

Can anyone help me for the Scjp dums? i need them jus to see the type of qus that are asked in the exam.

Member Avatar for peter_budo
0
51
Member Avatar for tone10lite

Im sorry earlier i didnt know the rules but i know them now. Ive been trying all day and this is the farthest i could get... [code=java] /** * Program designed to keep the inventory of books in a bookstore. * * @author * @version 1.0 Dveloped on May 3, …

Member Avatar for peter_budo
0
1K
Member Avatar for CSdude

I created a class that takes a 3 dimensional array and puts it in a txt file, the method is called output(). I can't figure out where to call the method though. I'm trying to have it so it is called when numb=4 in the actionListener on the bottom. Please …

0
48
Member Avatar for MrDiaz

Hi everyone, I'm working on an app that saves data on a text file, as we know, formatting text file is awful and not very user friendly. I'd like to save the information I've collected on my program on a nicely formatted excel file. Given the file it's already created, …

Member Avatar for MrDiaz
0
104
Member Avatar for eba4

I am trying to copy large files over a network using sockets and channels. Here is a code snippet //sender side FileInputStream in = new FileInputStream(inputFileName); FileChannel fromFile = in.getChannel(); SocketChannel toSocket = sendSocket.getChannel(); fromFile.transferTo(0, 999999, toSocket ); However, in the line where I call transferTo I get NullPointerException. Any …

Member Avatar for kvprajapati
0
110
Member Avatar for new_2_java

Hi all, I have a frame, which has several tabs. I would like to perform some actions, when user clicks on a tab. Can someone please tell me what's the event that I should look into? Thanks in advance.

Member Avatar for peter_budo
0
117
Member Avatar for Lensva

[code="java"] import java.awt.BorderLayout; import java.awt.Graphics; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import javax.swing.*; public class SketchPad { public static void main(String[] args) { SketchPad sketchpad = new SketchPad(); sketchpad.gui(); } public void gui() { JFrame mainF = new JFrame(); JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("file"); mainF.setJMenuBar(menuBar); …

Member Avatar for Lensva
0
83
Member Avatar for Laidler

i think theres something wrong with my computer, im trying to create a GUI for my program but it wont display my JLabels (which contain images) i downloaded a program with a GUI i made at the computer lab in my university which works there, but on my laptop it …

Member Avatar for BestJewSinceJC
0
96
Member Avatar for CSdude

My input file has 84 integers and I'm not sure what I'm doing wrong. PLEASE HELP! import java.util.*; import javax.swing.*; import java.awt.*; import java.util.Scanner; import java.io.*; public class Museum { private int Week=3; private int Hour=4; private int Day=7; int[][][] visitors = new int[Week][Day][Hour]; private int[] allWeeks; private int[] allHours; …

Member Avatar for BestJewSinceJC
0
91
Member Avatar for tone10lite

I need this by tonight if anyone could help out id appreciate it because im completely lost. Thanks. Write a project to keep the inventory of books in a book store. Create a book class with the following variables and methods Title Price Pages getTitle() setTitle() setPrice() getPrice() setPages() getPages() …

Member Avatar for BestJewSinceJC
-1
101
Member Avatar for jade387

if (iStream.close() I am stuck on how to use iStream to print [code] import java.io.*; import java.util.*; public class BucketSort { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // This is a scanner for the keyboard System.out.print("Enter a filename: "); String fname=sc.nextLine(); // This is the …

Member Avatar for BestJewSinceJC
0
103
Member Avatar for number87

I need to do paint a graphics into a nested panel. I am able to paint in a frame but when I add the class for painting into another JPanel, I see nothing. I know how to create nested panels but when I do it with a panel containing my …

Member Avatar for VernonDozier
0
267
Member Avatar for cullguy

i want to make a quiz game in java so tht the question come randomly and the answer get validated whn the user select the option...plz help me....

Member Avatar for peter_budo
0
166

The End.