32,204 Topics
| |
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 … | |
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:) | |
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: … | |
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> | |
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; } | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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) { … | |
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 … | |
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 … | |
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 … | |
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 … | |
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)); … | |
this is Kavi ,i am doing MCA in Madras university, looking for best java base ieee project center in chennai,could any one help | |
//****************************// //*****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 … | |
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 … | |
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 … | |
Hi ..... i want to stream the audio to the socket stream in java...... how to do that.... | |
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 … | |
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 … | |
[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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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; … | |
How to create multiple-choice questions in java using a certain time? |
The End.