32,204 Topics

Member Avatar for
Member Avatar for vishu.bhavsar

Hi all, I have come across the class JDatePicker which allows user to pick the date from the calender. But, I actually don't know how to use it. I have searched on the Google but didn't find much helpful information. Can anybody help me on this? Any help(e.g. examples) will …

Member Avatar for london-G
0
169
Member Avatar for Yoink

I need to create a Point and Rectangle class for a homework assignment and I'm unsure if I have the right idea with what im trying to do. In my Point class it much have a accesor and mutator, and also a distance method which is what im haveing trouble …

Member Avatar for NormR1
0
240
Member Avatar for enterpise

I'm not sure. This the right way to calculate percentage ? Here's my method public class percent extends Operation { @Override public Value calculate(Value key, Value value) { //BigDecimal result = key.getValue().divide(Value.hundred, Value.SCALE, BigDecimal.ROUND_UP); return new Value((key.getValue().divide(value.getValue()).multiply(Value.hundred))); // return new Value(result); } @Override public String getSymbol() { return "%"; } …

Member Avatar for enterpise
0
110
Member Avatar for jamesmadison43

import java.util.Arrays; import java.util.List; import java.util.Random; class DynamicArrayOfInts { private int[] storage; private int size; private final int INITIAL_CAPACITY = 8; private final int GROW_FACTOR = 2; public DynamicArrayOfInts() { storage = new int[INITIAL_CAPACITY]; size = 0; } private void rangeCheck(int index){ } private void ensureCapacity(int size_wanted) { int max_capacity …

Member Avatar for Taywin
0
176
Member Avatar for vishu.bhavsar

Hi all, I am creating one GUI application in java. I need to make menubar visible when particular panel is made invisible. Is it possible by creating an event which will be triggered when panel is made invisible? Can anybody help me? Thanks in advance!!!

Member Avatar for JamesCherrill
0
201
Member Avatar for popeyemissy

I need to fix the code. Once a war event takes place, no points are assigned however in the next deal whoever wins (be it the player or computer) should get double points. One point for the war and the second point for the next deal that was won as …

Member Avatar for JamesCherrill
0
312
Member Avatar for nsharif

Hi, This is my first post, I usually find solution by searching this forums However, I been working on my problem for 6 hours with no solution. Here what I'm trying to do I have a class that extends as JPanle also it implements ActionListener I'm trying to add JScrollPane …

Member Avatar for dimasalang
0
170
Member Avatar for oneoderja

Define a class called ‘twoInt’ with two public integer fields a and b In the constructor of ‘twoInt’, initialize the a and b to be 1 and 2 Create an instance ‘mytwoInt’ in the main method Write a method ‘swap’ (not the method of the class ‘twoInt’) and pass the …

Member Avatar for oneoderja
0
159
Member Avatar for tammy12w

so lets say you finished your program. you made the GUI and it runs fine. so everytime you want to run your program you have to go to python(or what ever you use) lauch it to see your program. my question is what code or what do you have to …

Member Avatar for TrustyTony
0
161
Member Avatar for apot_abenojar

hi. i have some questions..howtowrite a program that convert numbers to their equivalent words? example. 123 become one hundred twenty-three in 3 different language.

Member Avatar for nsharif
0
185
Member Avatar for hwoarang69

hi, i need help with bubble sort. i am not sure what are variable j and variable sort are for? public static void bubble_sort(int unsorted[]) { int i = 0; int j = 0; int sort = 0; while(sort == 0) { sort = 1; j++; for(i = 0; i …

Member Avatar for hwoarang69
0
189
Member Avatar for adityawkhare

Ok so i made a game in which a random no. is generated and user have to guess it. The game givesclues like Higher or Lower to user. When a guessed no is found a new jframe opens in a new class gui.class. Now i want to pass the argumets …

Member Avatar for NormR1
0
189
Member Avatar for TheHealer

Trying to write a for loop to insert buttons into the array. This is the code to create an array that can hold 7 values: JButton[] buttons = new JButton[7]; String[] buttonText = {"Circle", "Square", "Oval", "Smiley", "Swirl", "Start", "Stop"}; This is the for loop I'm not sure about to …

Member Avatar for NormR1
0
3K
Member Avatar for TheHealer

Trying to change the size of the shapes over time. Making them bigger as they move upwards and to the right, and making them smaller as they move downwards and to the left. This is the class that contains the move method: import java.awt.*; import javax.swing.*; import java.util.Random; public class …

Member Avatar for NormR1
0
1K
Member Avatar for Web_Sailor

Hi :-/ I have a java function that I want to call inside my JSP page. My function has got parameters.Now the problem is I cannot call it using JavaScript and if I put it inside <% %> tags it just executes while loading the webpage itself. I need to …

Member Avatar for hessah1986
0
203
Member Avatar for summey

Bellow is what i have so far on my assignment. I need some help getting this application working. Thank you for your time! /** General Assignment: Review the grading policy on the CSCI 181 syllabus. The course grade is determined by the weighted average of six components with two possible …

Member Avatar for NormR1
0
231
Member Avatar for Dane2259

Could someone please give me an idea of why I get a nullPointerException when I run this method in my main program. Every list has a variable, first, to store the address of the first node of the list. I assign current1 to the first node of list1 as a …

Member Avatar for NormR1
0
196
Member Avatar for Hemanth.Satkuri

String testHTMLContent = testhtml+productlogo; Message message = new MimeMessage(session); message.setFrom(new InternetAddress(usern)); message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to)); message.setRecipients(Message.RecipientType.CC,InternetAddress.parse(ccaddr)); message.setSubject(sub); //message.setText(body); // setDebugMsg("Attempting to send..."); Transport transport = session.getTransport("smtps"); MimeMultipart mimeMultipart = new MimeMultipart(); MimeBodyPart msgContent = new MimeBodyPart(); msgContent.setContent(testcontent, "text/plain"); mimeMultipart.addBodyPart(msgContent); MimeBodyPart query = new MimeBodyPart(); query.setHeader("Content-Type", "text/plain"); query.setContent(queryString, "text/plain"); mimeMultipart.addBodyPart(query); MimeBodyPart htmlPart = new …

Member Avatar for Hemanth.Satkuri
0
128
Member Avatar for rammiesteyn

Hi there, What i'm trying to accomplish is: These two methods: f(x : double) : double post: return x integral(og : double, bg : double, step : double) : double post : return (f(og) + f(og+stap) + … + f(bg)) * step So I can call those two in my …

Member Avatar for rammiesteyn
0
261
Member Avatar for sharonC

I have an interesting problem. I am working on a method that iterates through a number of simple java arrays stored in an Object array. The goal of this method is to find the smallest array contained within the Object array. Because these collections are stored in an Object array, …

Member Avatar for NormR1
0
217
Member Avatar for Rohan.India

I am working on a program where I am trying to solve a tree structure using the Node function I have to perfomr a arithmetic operation example ((1+2)*3) using a tree structure with left and right child. the complexity being I need to randomly generate the constants as well as …

Member Avatar for JamesCherrill
0
103
Member Avatar for jaydac12

HI ! could you please help me here? i'm having a problem on marking the books in my library program if it is borrowed or returned? here's where im at, import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.awt.Color; public class Library { ArrayList<String> bookName = new ArrayList<String>(); {{ …

Member Avatar for jaydac12
0
696
Member Avatar for rahul.ch

public class Thread7 implements Runnable { public static void main(String r[]) { Thread t = new Thread(new Thread7()); t.start(); public void run() { System.out.println("C"); System.out.println("D"); } System.out.println("A"); try { t.join(); System.out.println("B"); } catch(Exception e){} } } Query1: On compiling this program I get "illegal start of expression" error pointing to …

Member Avatar for delta_frost
0
272
Member Avatar for RozenKristal

THing is I have an assignment where the object is an array, I need to check when it is out of bound. But I dont understand what this statement means? Can you guys help me verify it? > method "private void rangeCheck(int index)": if the value of index is less …

Member Avatar for jamesmadison43
0
179
Member Avatar for alex.ametrano

I am having a problem completing this Java program. Basically everything is complete and running correctly except the end (which I cannot figure out the code for). The point of this program is to convert dates from the "Month Day, Year" format to "DD-Mon-YYYY" format and increment the dates by …

Member Avatar for NormR1
0
289
Member Avatar for Kathy0410

Hello everyone. I have this program to write for my college course. I listed the instructions below. The problem I have is the starting point. I don't know where to begin. Would it make sense to have a class called Sports, class called mySports, and then classes such as Basketball..etc …

Member Avatar for JamesCherrill
0
182
Member Avatar for zeroliken

I got the insert and Delete Data/Row working for my DBMS. The deleteRow method finds the row that contains the same primary key from the database, passed on to the method, and deletes the row. With using the insertRow method, the data I added shows on up on the last …

Member Avatar for Taywin
0
266
Member Avatar for Dizzy Noob

hello everyone, Ive been trying to alter strings and i am having a very difficult time altering the vlaue after i split them. i understand what i am doing when i split the input(String[] word = phrase.split(" ");), thanks to this site.. and how i am then able to alter …

Member Avatar for Dizzy Noob
0
280
Member Avatar for riahc3
Member Avatar for pritaeas
0
63
Member Avatar for crownedzero

I'm attempting to use the ObjectOutput/InputStream to write data to a file; I'm fairly certain I've got the out portion but coming back in isnt working as it should, thoughts? public static void writePersistant(ArrayList<PersistantObject> persistantRecords) { try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("dataout/population-record.ser")); for (PersistantObject i : persistantRecords) { …

Member Avatar for JamesCherrill
0
189

The End.