32,199 Topics

Member Avatar for
Member Avatar for hwoarang69

note x = player x postion y = player y postion so iam trying to set up collsion between player and enemy. i want it so my player touch the enemy than my player should stop. and not go though it. this code below kind of works. if my player …

Member Avatar for JamesCherrill
0
316
Member Avatar for Goldfinch

I was trying to building a java project with a run function. Problem is, the build file is located at the base directory and file with the main method is in the /contents/username/ subdirectory - I can't seem to properly call the file even though when I run Ant compile, …

Member Avatar for Goldfinch
0
171
Member Avatar for kedxu

I have two classes: (1) **Class A**, which extends JApplet, implements Runnable + some Listener stuff (2) **Class B**, which has a main method and is not an applet My question is, how do I create **class A** with **class B**'s main method? Is this even possible? What I'm doing …

Member Avatar for kedxu
0
249
Member Avatar for renzlo

Hi, Jim and All, How do you handle a java applet in a webbrowser control? It seems that no event fires up when a java applet is loaded in webbrowser control, by the way, the applet is in full screen and this is a company applet, meaning I did not …

Member Avatar for renzlo
0
160
Member Avatar for Amiro

**I am doing a mini project, I need help with how I can store the scores in an array. ** import javax.swing.*; // import the swing library for I/O class fi_project { public static void main (String[] param) { questionfilm(); System.exit(0); } // END main //************************************************************ public static void questionfilm() …

Member Avatar for JamesCherrill
0
225
Member Avatar for forjustincase

Today , i came across this code class Something { public static void main(String[] args) { try { System.out.println("In try block"); return ; } catch(Exception e){ System.out.println("Hello World in catch!"); } finally { System.out.println("Hello World in finally!"); } } } Now can anyone tell me the output with reason plz... …

Member Avatar for JamesCherrill
0
94
Member Avatar for trd360

The instructions are long but here goes. The starting code they provided me is after the instructions. The bar codes used on products in a store are visual encodings of Universal Product Code (UPC) numbers. For example, 036000291452 is a UPC code (in this case for a box of tissues). …

Member Avatar for ken_taiken
0
355
Member Avatar for forjustincase

ok here's what i am trying to do. i ask user for a value or just assign a value my self for example int a=150; now i want the output like this: 1 5 0 so is this possible?? please use simple programming i guess it can be done with …

Member Avatar for JamesCherrill
0
258
Member Avatar for hwoarang69

public class j_01_FLOW_06 extends JApplet implements ActionListener { //Choice shoplist = new Choice(); //ButtonGroup bg_group = new ButtonGroup(); CheckboxGroup cg_group = new CheckboxGroup(); JCheckBox cb_i1 = new JCheckBox("fafa"); JCheckBox cb_2 = new JCheckBox("wfw"); JCheckBox cb_3 = new JCheckBox("Computer"); String s_value[]={"white sox","red sox","mets","cordianls","blue jays"}; JList l_list = new JList(s_value); Container c; …

Member Avatar for hwoarang69
0
230
Member Avatar for hwoarang69

public class J_01_FLOW_08 extends JApplet implements ActionListener { String s_value[]={"white sox","red sox","mets","cordianls","blue jays"}; JList l_list = new JList(s_value); JLabel l_label = new JLabel(); Container c; FlowLayout flow = new FlowLayout(); public void init() { c = getContentPane(); c.setLayout(flow); c.add(l_list); c.add(b); l_list.addActionListener(this); } public void actionPerformed(ActionEvent e) { String pick = …

Member Avatar for JamesCherrill
0
164
Member Avatar for hwoarang69

so i now awt is the old version. which is Applet swing is the new version which is JApplet. code at bottom, is it normal to mix awt and swing? for ex i am using continer which is awt. and let say i dont want to mix awt with swing …

Member Avatar for hwoarang69
0
222
Member Avatar for caswimmer2011

Hi, I am making a program to open the application TextEdit on a mac (not a specific file, just open the program). I have been researching it, but have not come across much help. I have seen that I should use Runtime or Desktop classes, but i'm not sure which …

Member Avatar for caswimmer2011
0
330
Member Avatar for mahemaa.iyer

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { int c=0; String u1=request.getParameter("u1"); String e1=request.getParameter("e1"); String user=request.getParameter("user1"); request.setAttribute("u1",u1); request.setAttribute("e1",e1); request.setAttribute("user", user); out.println("welcOme"); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con =DriverManager.getConnection("Jdbc:Odbc:db5"); String str = "select * from Table1 where email=?"; out.println("welcOme"); PreparedStatement statement = con.prepareStatement(str); statement.setString(1,user); ResultSet …

0
148
Member Avatar for vicky.parikh.1

hello, i am corrently making a desktop application which store the username and passwords from different account. now,i want to know that how can i fill this username and password in particular web site when i click on button. i have written the code for opening the web browser,when i …

Member Avatar for stultuske
0
440
Member Avatar for SCass2010

Hi all, I was looking to make an android app that gets data from a C# wcf server - at the minute I can pull some basic data and they are communicating - however what is the best way to create an app like this? I know that networking operations …

Member Avatar for peter_budo
0
103
Member Avatar for coroll

Hi all, I'm developing a simple RMI chat server. Im getting following exception when i execute Client. Server works well. java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) at sun.rmi.transport.Transport$1.run(Transport.java:177) at sun.rmi.transport.Transport$1.run(Transport.java:174) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:173) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667) …

Member Avatar for JamesCherrill
0
288
Member Avatar for omgnametaken

Hey guys. I have two questions about my code(which has no errors but isnt giving the output i want)...Is it possible to have an if statement in my 3rd constructor? Also why is my output giving the filepath instead of outputting calcutations? Thanks for having a look public class order …

Member Avatar for omgnametaken
0
110
Member Avatar for soumyadityac

I cant get this program working. Cant really sort out where i am wrong. The program works fine without the save/load object feature. Please help!! import java.io.*; class Account { String name ,accno; double bal; void withdraw(double amt) { System.out.print("Processing"); for(double pr = 0; pr<500000000; pr++); System.out.print("."); for(double pr = …

Member Avatar for JamesCherrill
0
142
Member Avatar for anwatts

I am creating a program that has multiple classes. The program draws various shapes on a gui and the program needs to be modified to incorperate a highlighting function if a shape is clicked on. I have done the coding but it is not drawing the circle and I am …

Member Avatar for JamesCherrill
0
210
Member Avatar for xianamersu

I'm trying to make a video store program that allows customers to search for videos and either buy or rent them. I have already made a class with 3 subclasses, VHS, DVD and VCD. for the meantime,When video objects are first put into the store, the status should be “IN”. …

0
76
Member Avatar for Cronicle8

Hello, I'm building this app, which requires a Camera, but it is not working, it doesn't show anything except the design, here's teh code: Camera c = null; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.qrreaderscreen); SurfaceView v = (SurfaceView) findViewById(R.id.v); SurfaceHolder surface_holder = null; v = new SurfaceView(getApplicationContext()); if (surface_holder …

Member Avatar for Cronicle8
0
303
Member Avatar for sobias

Hi guys, Finally I've registered after being a very long visitor for this awesome community. I have this problem which consumed 2 days of my time trying to figure out how to solve it. And your help is needed guys. The problem says: Transfer elemenents from Stack1 to Stack2 , …

Member Avatar for Taywin
0
8K
Member Avatar for somjit{}

this is my code, from the book *Head First Java* ... class Echo { int count=0; void hello() { System.out.println("Helloooo....."); } } public class EchoTestDrive { public static void main(String[] args) { Echo e1 = new Echo(); Echo e2 = new Echo(); // output 10 //Echo e2 = e1; // …

Member Avatar for somjit{}
0
178
Member Avatar for ganges

hi suggest me a good exam prepration guide for "Java EE 6 Java Persistence API Developer Certified Expert Exam" Exam Number: 1Z0-898 thanking you

Member Avatar for stultuske
0
53
Member Avatar for 1bung100

I have created a simple client server chat program using socket. I used to run Client program and Server program separately in two eclipse and chat is done through console only. The logic is as below: System1Class (Server) | System2Class (Client) 1) SendThreadSys1 Class | 1) SendThreadSys2 Class 2) ReceivedThreadSys1 …

Member Avatar for 1bung100
0
1K
Member Avatar for FUTURECompEng

public void Enqueue(int value){ node end = endList.next; end.next=null; endList.data=value; endList.next=end; endList=end; Here is my code for an Enqueue method but when I run it mylist.Enqueue(12); It gives me an error. Is something wrong with my method or am I testing it incorrectly? Thanks.

Member Avatar for FUTURECompEng
0
294
Member Avatar for calvintmoss

So I am trying to make a tile map editor/reader to create and interact with maps like [this](http://www.codeproject.com/KB/game/Autotiles_Algorithm/TileMapExample.png) , so essnetially I am wondering what the best way to go about this would be. I have not done anyhting graphical in programming in a long time and yeah, I was …

Member Avatar for ObSys
0
776
Member Avatar for riahc3

Hello I want to be able to be on a page and have a favorite that points to http://localhost/export which is a web service. When I select that favorite, the current web page Im on should send all of its source code to the web service. The web service should …

Member Avatar for Taywin
0
224
Member Avatar for boopathyraj

I want to align two text in same line first text should be in left side another one should be in right side of java swing textpane. so I have using style interface and Styleconstants class to align text but it couldn't worked. I have applied some other styles on …

Member Avatar for JamesCherrill
0
297
Member Avatar for subrat_p

Hello friends, I have created three JComboBoxes. first two of them get list from string. However I select these two comboboxes, the third combobox automatically retrieve data of a particular column from my database. But in my code its only get data from first item which automatically seleted by setmodel …

Member Avatar for mKorbel
0
420

The End.