32,204 Topics

Member Avatar for
Member Avatar for jg1405

Thanks for the support! I have been working on a program with 7 classes, one the main and one starts the program, and I have been troubleshooting for a few hours trying to see why for one of the output constructors I'm not getting the classes to update the output. …

Member Avatar for Taywin
0
190
Member Avatar for hwoarang69

note i want to do this code in background class. not in main class. so i have a main class and a background class. getting error at url = getDocumentBase(); also getting error at getImage drawImage background class import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.awt.Rectangle; import java.net.URL; //#2 public …

Member Avatar for JamesCherrill
0
112
Member Avatar for lo0lo0999

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Bank1 extends JFrame { private JLabel l1; private JLabel l2; private JTextField t1; private JPasswordField p1; private JButton b1; public Bank1() { super("Bank System"); Container container = getContentPane(); container.setLayout(new FlowLayout()); l1=new JLabel(" ID :- "); container.add(l1); t1=new JTextField(25); container.add(t1); l2=new JLabel(" Password …

Member Avatar for mKorbel
0
215
Member Avatar for JamesCherrill

Like me you may be curious about the "closures" or "lambda expressions" that were supposed to be in Java 7 and are now the centre-piece of Java 8 (due next year). Also like me you may have Googled for some info, and discovered a smattering of technical articles explaining the …

Member Avatar for JamesCherrill
0
168
Member Avatar for hacker260

i need help finish this program for an assignment, It should play the Rock, Paper, Scissors game. The nextPlay methoded needs to be filled in with nested switches. thanks for your help import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Rps extends JFrame implements ActionListener { private final char moves[] …

Member Avatar for stultuske
0
302
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
250
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
232
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
225
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

The End.