35,618 Topics

Member Avatar for
Member Avatar for yue.sun.35

Hi guys I try to run this shell in java but it never works. Process p = Runtime.getRuntime().exec(" cat *.java|sed '/import/d'|sed'/package/d'>>b.java "); when I change the cmd to something like "ls" or "open foo.java" the code will works. Any idea why?

Member Avatar for jwenting
0
95
Member Avatar for j.t.casperson

Ok, so here I have a program that creates two boxes. The top box should start out with all 12 months of the year in it. What I'm trying to have happen is be able to move the months (through the two buttons) back and forth. Originally it just had …

Member Avatar for stultuske
0
138
Member Avatar for modesto916

Hi there, I'm just starting with Java and Desktop programming but I have some doubts, for example: You are going to write a new application, you go there, draw your ER for your database, UML, etc. My problems is when I need to integrate the interface with the program logic, …

Member Avatar for stultuske
0
208
Member Avatar for eod731

I need help converting my code into an ArrayList. We are only supposed to use an ArrayList and not an array. I didn't see that part of my project and not too good with using ArrayList. Please help me figure this out. public class Transcript { private Course[] courses = …

Member Avatar for bguild
0
240
Member Avatar for alek.mieczkowski

Hi All, Im working on a program for school which combines 3 programs together(one transposes a 2d array, one adds up the diagonals and tells them, and one adds the rows). The problem Im having, is with importing all the data into the 2 Dimensional array "input" so it can …

Member Avatar for alek.mieczkowski
0
191
Member Avatar for Aditya_4

record.jsp <%@page import="java.sql.*" %> <%@page import="beans.connection" %> <% try { Connection con=connection.GetConnection(); Statement st=con.createStatement(); String query="select * from empdetail"; ResultSet rs=st.executeQuery(query); ResultSetMetaData rsmd=rs.getMetaData(); int cols=rsmd.getColumnCount(); %> <table> <tr> <% for(int i=1;i<=cols;i++) { %> <th><%rsmd.getColumnName(i);%></th> <% } %> </tr> <% while(rs.next()) { %> <tr> <% for(int i=1;i<=cols;i++) { %> <td><%rs.getString(i);%></td> <% …

Member Avatar for IIM
0
136
Member Avatar for nah094020

Anyone know of a way to run multiple clients on netbeans for a java program, i need to test my server which takes in x amount of clients. Currently i can only run 1 client with my computers hostname and the server but cannot test if the server will work …

Member Avatar for jwenting
0
256
Member Avatar for game06

i just finished one game in java using JApplet. is there a way for me to use a database so i can keep track of scores? I am using xampp control apache for my website database to keep track of username etc.... in php. Can i connect to it using …

Member Avatar for jwenting
0
167
Member Avatar for riahc3

Hello Sometimes I update my web service JAR by deleting the old one (waiting for the undeploy message to appear on the console) and putting the new one (and seeing the deploy message) and when I call it, it gives a heap size error. I have to restart the PC …

Member Avatar for jwenting
0
256
Member Avatar for nah094020

Just wondering how do i get all the nessecary files for my project on netbeans because, when i use the add existing item, i tend to forget where i got it from and have trouble organizing it. Is there a way to find where the file is located at?

Member Avatar for nah094020
0
194
Member Avatar for bubunchan

public class review{ //method code public void start() { int a, b; a = 5; b = methodA(a); System.out.println(a + " " + b); } private int methodA(int a) { int b = 10; a = a + 5; return a + b; } //method end } ------------------------------------------------ i compile …

Member Avatar for somjit{}
0
268
Member Avatar for Violet_82

Hi all it's that time again, java exercise! Mindful of what happened last time http://www.daniweb.com/software-development/java/threads/449525/building-a-simple-airline-reservation-system-exercise/ , this time I have decided that I want to have all the pseudocode done before I even start thinking about how to code the whole thing. This is what the exercise requires: > Create …

Member Avatar for Violet_82
1
4K
Member Avatar for G_S

Hello people. I need an explanation about inheritance I got a little confused in class: This is the modelling problem: There are two objects: doctors and patients. They are expected to have only the following attributes: Doctors have: name, age, id, and salary Patients have: name, age, id, and disease …

Member Avatar for G_S
0
196
Member Avatar for sim_pack

i have this code to render a locally saved html file onto a jframe. i have the following problems with how the html was rendered: 1. the texts of the 'webpage' do not wrap; 2. in order to solve my problem in 1. above, i added a JScrollPane, problem is, …

Member Avatar for sim_pack
0
568
Member Avatar for anisha.silva

Hi, I am reading this book to learn about web services. How do I compile the exercise given in chapter 1. Appreciate a reply. in cmd do i go to eac directory and compile and execute the code. Really appreciate a reply thanks

Member Avatar for stultuske
0
214
Member Avatar for l.worboyz

**Task:** "pass these four variables (x,y,w,h) into the getSubimage method of the original_image object." That method returns a BufferedImage, which i need to directly return from my getImageRect method. I have not included my whole code, but i was wondering if anybody could help me out with this? If you …

Member Avatar for JamesCherrill
0
2K
Member Avatar for pooran.c

import java.text.SimpleDateFormat; import java.util.Date; public class StringtoDate { public static void main (String args[]){ String inputDate = "04.11.2013 11:14:45 GMT 00:00"; Date dat = convertStringToDate(inputDate); } public static Date convertStringToDate(String inDate){ SimpleDateFormat sdf = new SimpleDateFormat("mm.dd.yyyy hh24:mm:ss"); Date date = new Date(); try { date = sdf.parse(inDate); } catch (Exception …

Member Avatar for pooran.c
0
2K
Member Avatar for jvcv

How to implement GUI to my code? I know how to make the buttons and etc i just dont know how to "connect them together" thanks `import java.util.Scanner; public class Pizza { public static void main(String[] args) { Scanner inScan = new Scanner(System.in); int choice, choiceEnd, howMany, pizzaNumber; double totalCost, …

Member Avatar for JamesCherrill
0
124
Member Avatar for Imene Hertha

just started programing with java, did microsoft visual basic last semester, but java seems more case sensitive, how can i write a program called CheckPassFail, which prints "pass" if the int variable "mark" is more than or equal to 50; or prints "fail" otherwise.***please help***

Member Avatar for <M/>
-3
345
Member Avatar for justin.dienger

Develop a Screen, a Listener, and an Animator. The screen should have a panel in which a filled ball should be continuously moved. There should be four buttons on the screen. Two (2) buttons on the Screen for movement – labeled Left-Right and Up-Down. The movement of the ball should …

Member Avatar for stultuske
0
2K
Member Avatar for jspence29

I can't figure out why my java applet is not displaying, I have all of the files in the same folder, and I have java enabled on my browser. Here is the code //java code import java.applet.*; import java.awt.*; import javax.swing.*; /** * The HelloWorld class implements an applet that …

Member Avatar for bguild
0
314
Member Avatar for game06

i am drawing two rect in paint method. 1st rect i want to rotate it but 2nd rect i dont want to rotate it. the code i have should rotate only 1st rect but the problem is that when it rotate it missup the x, y postion of rect. this …

Member Avatar for Ezzaral
0
183
Member Avatar for game06

i have asteroids store in arraylist. i want to check collision between player and asteroids. if player get hit than i want to minus one life and move the asteroid backwards so it look like it bounced in to player. right now this code is check for collision between player …

Member Avatar for bguild
0
187
Member Avatar for azdonald

Hi I'm working on a JSP project and i need to retrieve saved images. The images are save on my computer(C:\Users\myuser\Documents\NetBeansProjects\Nomadi\web\Images) I saved the link to a MYsql database.. this is the link i saved(\web\Images\W101.jpg) Nomadi is the project name. When i run my app, the image doesn't show. What …

Member Avatar for LastMitch
0
160
Member Avatar for bibiki

hey there, I have two classes with a one-to-many relationship. For ilustration: public class Customer { Business business; Date created; } public class Business { } Now, when I do the following: new StringBuilder().append("SELECT business FROM ").append(Customer.class.getName()) it works perfectly fine. However, when I include filtering based on created field …

Member Avatar for bibiki
0
142
Member Avatar for inabahtrg

Good day I’m new with JSP, here the problem, I just converting the code from SQL to PostgreSQL, but a problem occur after I change to DataSource ds = (DataSource)envCtx.lookup( "jdbc/postgres" ); and add a scheme to the query. By theory it should be ok but it produce this error …

Member Avatar for LastMitch
0
2K
Member Avatar for G_S

Hello I am a little confused. I had always thought that a class can have objects from other clases as attributes. My teacher recently told me that this is not true... so I am confused now: if one of the attributes of my class is a String, would that be …

Member Avatar for G_S
0
195
Member Avatar for shoaib672002

Ok this the problem i want to download the applet or if not i want it as a animation (swf or gif) Go to this website http://www.colorado.edu/physics/2000/index.pl then click applet tumbannails then go to laser (by srcolling) i want all four applets or make into animation

Member Avatar for stultuske
-1
42
Member Avatar for MasterHacker110

I made this very simple applet just for fun but it doesn't work: package applet; import java.awt.*; public class Applet extends java.applet.Applet { public void init() { } public void paint(Graphics g) { g.drawOval(0, 0, 250, 100); g.setColor(Color.RED); g.drawString("First Applet", 10, 50); } } And heres my HTML code: <html> …

Member Avatar for JamesCherrill
0
185
Member Avatar for chdboy

I have Class called ConnectionDB and in this class I have Main method and another function in the class ConnectionDB,That is private static Connection DBConnectionstring() In this function I have Connection URL ,Drivers inside this function . I want this function to be used in another class (GUILogin) with main …

Member Avatar for chdboy
0
205

The End.