35,618 Topics

Member Avatar for
Member Avatar for lauraroxi

Hello. I have a project for queues simulation to do and I have to follow the MVC pattern. My classes until now are: Client, Queue which represent the Model, Controller, GUI which is the View, and the Main class. If I have those 2 classes representing the Model, how should …

Member Avatar for lauraroxi
0
127
Member Avatar for Sacrificer_911

How would you implement "clickable" game elements, like they are buttons. But of course, they can move still.

Member Avatar for JamesCherrill
0
134
Member Avatar for shopnobhumi

Hi, i want to convert a .jsp file to .java file. I read various forums and they said to use tomcat to convert .jsp to .java.I have ran tomcat but it is not doing anything(i cannot write anything). Through command prompt i ran it and it just opens a new …

Member Avatar for stultuske
0
4K
Member Avatar for elhkei

write a program that will create a phonebook,wherein you can add **entries in the phonebook,delete** entries,View all entries and Search **entries.In viewing all entries, the user should have a choice,whether to view the entries in **alphabetical order or in increasing ** order of the telephone number.In searching for entries, the …

Member Avatar for elhkei
-1
174
Member Avatar for game06

error: The method paint(Graphics, main) in the type player is not applicable for the arguments (Graphics, main.Display) on line: player_class.paint(g) main.java public class main extends JApplet { Timer timer; Display display_class; Player player_class; /*** init method ***/ public void init() { setSize(800, 400); display_class = new Display(); setContentPane(display_class); }/*** end …

Member Avatar for game06
0
258
Member Avatar for hashim5003

Can any one help me writing code which can only creat three digit random number not two digit or one digit number? Following code creates 3 digti but also creats two and one digit number.. public class random { public static void main (String [] args) { double n = …

Member Avatar for hashim5003
0
7K
Member Avatar for paku_dnj

my password program can hide keyboard input . its invisible when i type password. But my qus is how can show password input as asterisk (*) can any one help me please? :p my code is here: public void login() { Scanner input = new Scanner(System.in);//create Scanner object System.out.println("\n"); Console …

Member Avatar for ~s.o.s~
1
10K
Member Avatar for jspence29

What I am trying to do is make a program that reads a txt file and converts the number into a double array. import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class rocket { public static void main(String[] args) throws IOException, FileNotFoundException { System.out.println(readLines("/Users/Jeremy/Documents/workspace/altitude.txt")); } public static Double[] readLines(String …

Member Avatar for jspence29
0
398
Member Avatar for game06

i have a sprite sheet(image) and i want to draw on screen. image = sprite sheet image x = player x postion y = player y postion width = player width height = player heigh public class main extends japplet { ... public void paint(Graphics g) { g.drawImage(image, x, y, …

Member Avatar for mKorbel
0
2K
Member Avatar for rayidi

Dear All, I'm developed an application that can read incoming messages. Upto now all its fine, Now my app crashing sometimes and return `NullPointerException`. Please find my error log below. java.lang.RuntimeException: Unable to start receiver me.radhakrishna.buddyreader.TextMessageReceiver: java.lang.NullPointerException at android.app.ActivityThread.handleReceiver(ActivityThread.java:2146) at android.app.ActivityThread.access$1500(ActivityThread.java:127) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1208) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4441) at …

Member Avatar for peter_budo
0
923
Member Avatar for Markancia

I am a beginner in j2ee, I met a problem when retrieving an image already stored in the database. I am using Hibernate and JSP, the code I used is as follows: / / java code: s.setAttribute ("photo", l.getPhoto ()); StringTokenizer st = new StringTokenizer (s.getAttribute ("photo"). ToString (), "/"); …

Member Avatar for LastMitch
0
360
Member Avatar for mydreamgirl

Tried following code to get timezone conversion and failed. public static String ConvertTmz(String timeFormat, String timeStr, String tmz){ String theTimeFormat="MM/dd/yyyy HH:mm:ss"; if (timeFormat!=null) theTimeFormat=timeFormat; SimpleDateFormat sdf = new SimpleDateFormat(theTimeFormat); sdf.setTimeZone(TimeZone.getTimeZone(tmz)); GetTimeStr(timeStr); GregorianCalendar time=new GregorianCalendar(yyyy, mm-1, dd, hh, mi, ss); return sdf.format(time.getTime()); } Please help.

Member Avatar for JamesCherrill
0
344
Member Avatar for Neha290791

hi.. iam developing a jsp application. Iam using two columns called open_time and resolution_time. The thing I want is the time difference between two dates but iam unable to do so. please guide me accordingly. Iam using timestamp for the date & time.

Member Avatar for LastMitch
0
775
Member Avatar for zdneth

I would like to ask on how to do calculations and saving the result and retrieve again just like making a deposit and withdrowal in banking system. i really dont know how to do so.. i am trying to formulate some codes but it just don't work. Pls help. I …

Member Avatar for IIM
0
254
Member Avatar for zdneth

I would like to ask some help on how to add/subtract a value in java from a certain value in a database. I need this very badly!! PLs HELP.

Member Avatar for IIM
0
130
Member Avatar for rancosster

I have a problem with creating drag and drop in Swing. I have written class that represents the toolbar item here is the code shortened code for it: public class ToolbarItem extends javax.swing.JToggleButton implements IToolbarItem, Transferable, DragSourceListener, DragGestureListener { private ModelEquivalent _modelEquivalent; private DragSource _dragAndDropSource; private TransferHandler _itemTransferHandler; public ToolbarItem(ModelEquivalent …

Member Avatar for rancosster
0
459
Member Avatar for SHINICHI

Hi everyone..I need a little help here.Can anybody teaches me on how to create a class diagram for the process of buying glasses from the viewpoint of the patient. The first step is to see an eye doctor who will give the patient a prescription. Once the patient has the …

Member Avatar for JamesCherrill
0
268
Member Avatar for Neha290791

Hi, iam new to jsp. actually my problem is with the format of date and time.Datea nad time stored in database are in hh:mm:ss format. but when i am displaying reports, nanoseconds are displaying. please give reason for this.

Member Avatar for radhakrishna.p
0
184
Member Avatar for BoDuke1835

I am working on a java assignment where I have to get BMI with dialog boxes. I keep getting this error "error: illegal start of expression if (BMI = > 18.5 && BMI < 24.9) " Here is the code. Can someone please help!? import javax.swing.JOptionPane; public class BodyMassIndex { …

Member Avatar for stultuske
0
192
Member Avatar for game06

how to store 2d array in arraylist? and how to print arraylist? import java.util.ArrayList; public class aaa { public static void main(String[]args) { ArrayList<Integer[][]> aa= new ArrayList(); ???????????? int bb[][] = { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }; for(int y = 0; y < bb.length; y++) //rows { for(int …

Member Avatar for stultuske
0
289
Member Avatar for asifalizaman

hi!guys i hope you all will be fine . Today i want to know from you about the Java Application? According to my views or my knowledge may be i am wrong.There are two types of application in java which is **1. Java Stand-alone Application 2. Java Applet Application** I …

Member Avatar for stultuske
2
252
Member Avatar for toldav

I need help to fix this two errors in the code. Line: 29 The static method isSolvable() from the type LinearEquation should be accessed in a static way. Line: 39,40: The static method getX() from the type LinearEquation should be accessed in a static way. Thank you. // This is …

Member Avatar for radhakrishna.p
0
366
Member Avatar for chandub

hi. when a user request hits the ActionForm's validate method (struts)and bounces back, i'm loosing some request attributes that i had set for the page. In other words, if the user inputs some data that don't pass the validate method, the page comes back with a few request scope attributes …

Member Avatar for LastMitch
0
211
Member Avatar for solomon_13000

I wrote the following code: package com.chain; public interface Chain { void setNext(Chain chain); void process(int number); } package com.chain; public class ProcessNegative implements Chain{ private Chain chain; public void setNext(Chain chain){ this.chain = chain; } public void process(int number){ if(number < 0){ System.out.println("Negative"); }else{ chain.process(number); } } } package …

Member Avatar for solomon_13000
0
238
Member Avatar for eric.neuls

Okay so i am trying to code out a canvas that has two complex objects(I have MainCanvas , Human, Dog) and I want to make a piece of the complex object move when i drag it, but i dont know if i need to put in another moving method in …

Member Avatar for M4trixSh4d0w
0
147
Member Avatar for ellosbibu

i had to do a complete text editor,so i made two different code. the fisrt code is a text editor that open docx file, create new documents , exit, paste , copy, delete, select all, save and save with name. the second code is another text editor that change colour …

Member Avatar for JamesCherrill
0
186
Member Avatar for gkaran487

hi. The file called test.txt contains names as John Smith Walter H. Kepler Gary Davies and so on.. I need to read only the lastnames from the file so that I can sort it in alphabetical order.For this I read the name as John Smith then go backwards as h,t,i,m,S …

Member Avatar for JamesCherrill
0
178
Member Avatar for twonjee2002

I am using a java program to read lines from csv and insert them into mysql database. Whenever i run my program i discovered i could not insert values into a date field insert mysql if the value comming from the file is null. However if i change the field …

Member Avatar for jwenting
0
153
Member Avatar for jemartalaban_1

is there any java programming software that looks like vb6 ? our panelist said on our thesis defense that we must use java for our interface but we dont have any background in java programming, but only vb. please help. thanks

Member Avatar for jwenting
0
276
Member Avatar for happygeek

FireEye security researchers are warning that they have [detected a new zero-day vulnerability](http://blog.fireeye.com/research/2013/02/yaj0-yet-another-java-zero-day-2.html) that is being used successfully in the wild against browser clients with both Java 6u41 and Java 7u15 installed. Given that the Java 7 update was only released a couple of weeks ago, this is yet more …

Member Avatar for jwenting
3
1K

The End.