32,204 Topics

Member Avatar for
Member Avatar for saeef007

Write a Java program that prompts for an individual’s age and prompts him/her to pay the price of a train ticket based on the following conditions: If age is greater or equal to 12 but less than 65, Rs 375.75 is charged. If age is less than 12 but greater …

Member Avatar for nira9
-2
107
Member Avatar for noel9

hiee friends i want to do a web application in java for that i wnat some good creative ideas i havent make any web application but i do have knowledge about java so for dng this project where shld i start what shld i refere......plzzz give ur valuable suggestions... thanku:)

Member Avatar for JamesCherrill
0
101
Member Avatar for jagvllead

import java.io.Console; public class ConsoleDemo { public static void main(String[] args) { Console cnsl = null; String name = null; try{ // creates a console object cnsl = System.console(); // if console is not null if (cnsl != null) { // read line from the user input name = cnsl.readLine("Name: …

Member Avatar for JamesCherrill
0
1K
Member Avatar for techyworld

value="jdbc:mysql://localhost:8080/mkyongjava" i need to change this path so that it works at my place. where will I get this? <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:8080/mkyongjava" /> <property name="username" value="root" /> <property name="password" value="password" /> </bean>

Member Avatar for cool_zephyr
0
181
Member Avatar for techyworld

how to do a unit testing on this method? anyone can help plzz? public boolean saveOrUpdateUser(User user) { boolean res = false; try { this.getHibernateTemplate().saveOrUpdate(user); res = true; } catch (DataAccessException e) { res = false; this.logger.error("DataAccessException", e); } return res; }

Member Avatar for techyworld
0
137
Member Avatar for somjit{}

whats even more is that if i create any new file in the "src" folder of the project , it doesnt create any new bin folder to place the class file. i dont know where the class files are of the compiled source code . only when i manually `javac …

Member Avatar for somjit{}
0
4K
Member Avatar for Trap910

I am new into the computer Science..I just completed reading and understing the C programming language..I think am quite decent in it..Now I want to start studying a new programming language this semester, before I start, I want to get some advice from the experts, should I choose Java or …

Member Avatar for vegaseat
0
282
Member Avatar for RinzLove

Hi all, Really appreciate your help if my function on dijkstra algorithm is correct or wrong? Many thanks... Function Dijkstra(Graph, source): Graph randomGraphGenerator = new Graph: Source V0 = new Source: for each vertex n in randomGraphGenerator: // initializations weight[n] := infinity // Unknown path // function from source to …

Member Avatar for JamesCherrill
0
200
Member Avatar for durgesh1

hello all i tried to fetch data from databse and try to stored it in an array and i want to compare new value that come from database with array if this new value is already stored in this array i like to executed new query if not in array …

Member Avatar for durgesh1
0
239
Member Avatar for Rampee

Hi Dude, I need to design an application similar to windows media player. Many suggested to me JMF but my actual need is it should be exactly same as windows media player. In my swing window, I should have the capability to add/edit playlists. If double click it should get …

Member Avatar for JamesCherrill
0
123
Member Avatar for techyworld

Hi i need some help, how to unit test a DAO? here my code: @Transactional public class ProjectDaoImpl extends HibernateDaoSupport implements ProjectDao { Log logger = LogFactory.getLog(this.getClass()); private String message; /** * {@inheritDoc} */ public List<User> retrieveAll() { return this.getHibernateTemplate().loadAll(User.class); } /** * {@inheritDoc} */ public boolean saveOrUpdateUser(User user) { …

Member Avatar for techyworld
0
147
Member Avatar for MasterHacker110

I am trying to read all the files in a folder, if the file name == that of the name the user entered, the text of a button (that when on clicked will open the file) will be set to the file name. But my code for some reason doesn't …

Member Avatar for MasterHacker110
0
273
Member Avatar for moone009

I would like split to some how split each item in the arry and sort it by Id[1] and then date[2] Been doing a fair amount of reading and cannot seem to figure this one out. Name,ID,Date John,432,2012-03-21 04:32:00 AM Bob,532,2012-01-01 12:12:00 AM Mike,932,2012-01-11 11:42:00 AM Mike,932,2012-05-01 12:13:00 AM John,1532,2012-01-11 …

Member Avatar for JamesCherrill
0
194
Member Avatar for darkenmac

Hey guys, I'm tring to develop an android application which will solve differentiation and intgration problems and show the steps to solving it. Like a learning tool for students. But the thing is i cant find a algo which will help me on solving integration. can u guys please help …

Member Avatar for DarkLightning7
0
136
Member Avatar for MasterHacker110

Ok so I have this problem: A friend that does a lot of online banking wants to keep track of their activity, so they save the "information" in a .docx file every time they are done. Now recently they have so many files that it is a hassle to search …

Member Avatar for MasterHacker110
0
174
Member Avatar for laguardian

Hey guys! I have this program I'm working on, but I keep getting an error in my main class. Here's what I have: import java.util.Scanner; public class TicketingSystem { public static void main(String[] args) { Game game = new Game(); Scanner input = new Scanner (System.in); String teamName; game.addTeam(new Team(teamName)); …

Member Avatar for somjit{}
0
138
Member Avatar for globaladchennai

this is Kavi ,i am doing MCA in Madras university, looking for best java base ieee project center in chennai,could any one help

Member Avatar for somjit{}
-3
196
Member Avatar for bob.henry.1884

//****************************// //*****DO NOT TOUCH THESE*****// //****************************// import java.util.*; import java.io.*; public class NumberGuessingGame{ public static int num; //variable to hold randomly generated number public static int guess; //variable to hold user inputs public static String ans; //variable to hold user input for y/n public static int guessnumber = 7; //variable …

Member Avatar for bob.henry.1884
0
250
Member Avatar for dalawh

I want to add different Enums to a single JComboBox. Here is how the code looks like. Type contains 3 different type of Enums(Colors, Shapes, Dimensions). final JComboBox typeJComboBox = new JComboBox(Type.Colors.values()); for(Type.Shapes shape: Type.Shapes.values()) { typeJComboBox .addItem(shape); } for(Type.Dimensions dimension : Type.Dimensions.values()) { typeJComboBox .addItem(dimension ); } What generic …

Member Avatar for JamesCherrill
0
794
Member Avatar for rwagnes

I am working on a class assignment in Java. According to the teacher's notes, a method in a sub-class that overrides the parent's method should be bold in the class diagram. I am using Visual Paradigm to create the class diagram, but I can't figure out how to bold a …

Member Avatar for jerry mcmartins
0
129
Member Avatar for sankubha
Member Avatar for JamesCherrill
0
395
Member Avatar for murali2489

Hi All, In MY GUI app, inside JFrame, i need to put two rows 8 column components first and then below i need to put one button in the center . I created one Jpanel having 2*8 grid layout and placed the components for two rows there and have put …

Member Avatar for murali2489
0
245
Member Avatar for Vaspar

Hello, I have made android application which provides remote desktop administration, I used port 5556 and socket programming TCP. I have to forward this port from router on every computer is there any other way so I can use some open port to communication with android device?? Like TeamViewer doesn't …

0
169
Member Avatar for crestaldin

[COLOR="navy"]I am trying to write a code to count the frequency of characters in a String; For example if I have String str = new String("This is a test"); I want to count the number of occurrence of each character in the string.(assuming the code is case insensitive) This is …

Member Avatar for JamesCherrill
0
430
Member Avatar for andre.gartner.56

I'm having quite a few errors on this one. This is my first attempt on "free" coding outside tutorials. I do believe it only has to do with bad use of brackets from my side, but i'm a beginner. Line 14 - Illegal start of expression Line 18 - Class, …

Member Avatar for JamesCherrill
0
155
Member Avatar for Peter_Aye

Hi. Please could anyone help me look at this code and tell me why the image is not getting drawn? I have already cross-checked the path, and it is alright, as it does not throw any exception. Thanks in advance. class PotPanel extends JPanel{ public PotPanel(int width, int height){ Dimension …

Member Avatar for mKorbel
0
263
Member Avatar for Stuugie

Hi All, I'm trying to loop through and open PDFs in a folder using Java. I have the following code: import java.awt.Desktop; import java.io.File; import java.io.IOException; public class OpenPDFs { public static void main(String[] args) throws IOException { // TODO code application logic here String fp; fp ="S:\\Economic Forecasts\\Fcst13\\SourceForecasts\\"; File …

Member Avatar for Stuugie
0
585
Member Avatar for sankubha

I have renderer a JPanel at the fourth column of my JTable. I need to draw an image Dynamically. I have used this code to get the component...... at certain row and column..... JPanel cPanel = (JPanel) jTable.getCellRenderer(0, 4).getTableCellRendererComponent(jTable, jTable.getValueAt(0, 4), false, false, 0, 4); Graphics graphics = cPanel.getGraphics(); When …

Member Avatar for sankubha
0
234
Member Avatar for RinzLove

Hi all, I've a problem fixing the syntax error. I'm doing a function, randomGraphGenerator(int n) that will generate non-negative weighted complete graph with n vertices. Could you help me out on this. Many thanks in advance... public class randomGraphGenerator { private final int n; private int E; Private Bag<Edge>[] adj; …

Member Avatar for JamesCherrill
0
333
Member Avatar for jakarias
Member Avatar for jwenting
0
202

The End.