32,199 Topics
| |
I have this code which saves the value into database from JSpinner SpinnerListModel monthModel = new SpinnerListModel(); String[] monthStrings = {"1Month","3Month","6Month","1Year"}; //get month names monthModel = new SpinnerListModel(monthStrings); JSpinner spinner = new JSpinner(monthModel); statement.setString(28,(String)monthModel.getValue().toString().toUpperCase()); But how to get that value back for Editing? I tried spinner.setText((String)monthModel.getValue(),29); But it says The … | |
Hi all, I am having an issue with getting my Jbuttons and JComboBox alignment properly in the JPanel. I have tried changing the coordinates of the GridLayout around to try to satisfy, but they are working properly. I am trying to get my radio buttons to the far right and … | |
Hello, all. The following is a problem I'm currently working on. I can't get it to run like the problem asks. Any help would be greatly appreciated. | |
When I click on Button which fetch records from the database it works fine public void fetchrecords() throws SQLException { Statement stmt = null; String query = "select * from Employer where Fileno=1"; try { stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); rs = stmt.executeQuery(query); while (rs.next()) { firstNameTextField.setText(rs.getString(2)); lastNameTextField.setText(rs.getString(3)); addressTextField.setText(rs.getString(4)); //and more records. … | |
I dont understand why the image isnt appearing! please help.. import javax.swing.*; import java.awt.*; //import java.awt.event.*; public class level2 extends JFrame{ Container con= getContentPane(); ImageIcon bg= new ImageIcon("D:\\Raptor\\background3.jpg"); JLabel back= new JLabel(bg); level2(){ setDefaultCloseOperation(EXIT_ON_CLOSE); setLayout(null); setSize(1300,700); back.setBounds(0,0,500,500); con.add(back); setVisible(true); } public static void main(String[] args) { new level2(); } } | |
| I have created a linked list and I wish for the user to enter a Station and then the output is the number stored for that station. LinkedList myList = new LinkedList(); myList.addFirst("London", 5); myList.addNode("Manchester ", 10); myList.addNode("Liverpool", 20); myList .addNode("Birmingham", 50); This is the input for the user to … |
Write a Java program which adds all numbers that are multiples of either 7 or 9 up to 600. Ensure that numbers like 63 are added only once in the sum. Thanks for help | |
My assignment is to create a program that asks the user what they want to do: 1-add a member, 2-delete a member, 3-see the arraylist of members, or 4- exit. I have the menu popping up, but I can't get it to go back to the menu after I execute … | |
Hello, I am trying to execute a jar file with higher version of jdk. But it fails & the worst part is I am not getting any error message. Jar file compiled verison: jdk 1.5 Executed version: jdk 1.7 I assume the jar file is downward compatible. thoughts pls? Thanks! … | |
Hi all, I wonder if you can help me with this. I am looking at a fairly long (well at least for me) java program, about 700 lines. Basically it's a very very basic simulation of an ATM that can run on a computer. Now, in all the classes I … | |
i want to get text from console screen for example System.out.println("hello"); i want to get that "hello" and store it in string how to do that????? | |
Hi, not sure if this the correct thread to post this question. I am working with the eclipse plugin project to creat and editor. And I want to highlish certain words for the editor. I was researching and found have to use syntax coloring. I didnt get a good tutorial … | |
I think that my problem is quite easy to be solved by hard coders like you :-) Its a conversion of binary number to decimal and hexadecimal. I cannot find why i am keep having errors in my two classes. Here is the code: **Main :** public class Times { … | |
Hi Team, I have been trying to understand the concept of RMI by writing a simple classes for 1. RMIInterface 2. RMIServer 3. RMI Client I have written three classes in eclipse and started RMIRegistry by running start rmiregistry command. When i tried to compile RMI server class im getting … | |
Hi, I would like to load the data from a SOAP response XML file to a MySQL table. Sample SOAP XML would be http://data.gov.in/sites/default/files/Ashgourd_2012.xml. I have to write a program to populate the data. I'm not very familiar with Java Web Services. I've worked with Struts2 and basics of Spring. … | |
I have a String which has been splitted like this String companyinforstring ="Company name.:Company profile no 1.:Company profile no 2.:Company profile no3.:---------------------------------------------------------------:Company address, :Street number, :Area,Area no2, :City. "; for (String retval: companyinforstring.split(":")) { System.out.println(retval); graphics.drawString(retval.toUpperCase(), 250, 200); } The Problem is that String which has been splitted, overlaping each … | |
hi, i dont know how to solve it can you help me please??? Create a java program that will do the following: # read 3 inputs from the keyboard # • two input numbers each being a single digit (0…9) • one character representing one of five operations : + … | |
I have to fix programme where the programme asks the user for an input of a random text. When the text is written in the programme will change specific letters like a to be c so I am a man would be I cm c mcn public static void main(String[] … | |
My interactive educational software has applets embedded in webpages. All was fine until I installed the latest Java7. Now all the applets are blocked, with some comment about my security settings being responsible for the blockage. I've tried everything I know to no avail. How do I get my applets … | |
I'm not able to get the printout. here is the code public class Billing extends Frame implements ActionListener,Printable { JButton printbtn = new JButton("Print"); } public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException { if (pageIndex > 0) { return NO_SUCH_PAGE; } // User (0,0) is typically outside … | |
Hello, The program below has two JPanels. The first JPanel, panel contains the labels, buttons and combobox. The second JPanel, panel_1 has the image.I am using BoxLayout to line up the belows vertically. The issue I am having is when I run the program, the compoments of the panel do … | |
Hello, I got a homework. This is too difficult to me. Because, I have just learned about the introduction of Java Networking. I still didn't get a enough material about Java Networking programming. This is the task that I got: [https://dl.dropboxusercontent.com/u/61841244/CS1103%20-%20T1%202013-2014_%20Lab%2011%20Unit%207.pdf](https://dl.dropboxusercontent.com/u/61841244/CS1103%20-%20T1%202013-2014_%20Lab%2011%20Unit%207.pdf) This is my question : - what is the … | |
I want to execute WordPad using the code below. It runs fine on my pc. But failed to run on other pcs. String program = "C:\\Program Files\\Windows NT\\Accessories\\wordpad"; String file = "srcFiles\\Resources\\readme.rtf"; //This is the path to the file i want to open with wordpad. Runtime load = Runtime.getRuntime();; try{ … | |
Hi This app is supposed to let a person draw depending on their choice of Shapes and color. I cant figure out what is going wrong. The colours and shapes barely work and the mouse position is not showing up at all. Mouse listener that tracks mouse position seems to … | |
Question regarding concurrency. Imagine 10 different doGet() requests from 10 different users around the world called within milliseconds of each other to a servlet called LoginServlet.java. Inside the servlet's doGet() method is a call to DbUtil.getConnection(). The DBUtil class is static and the method getConnection() is also static. What happens … | |
Hi. I was wondering if someone could explain to me how to make some new node point to the first element in a list. | |
Hi. I need help with my size method. I am using a single-linked list. I tested my code and it returns 0 all the time. /** This method returns the size of the current list. <br> * If the current list has no elements,it is empty. <br> * * @return … | |
This a question please schools grades ------- -------- havard 90% with this table, i want to select the information in each column concatenate them and ouput the results in a textfeild. sample output = havard/90% so can you declare a column in mysql as a variable in java? if yes … | |
I have the following code that prints out something like a database using a velocity engine and the output is printed to a console. Though what I'm asked is to generate HTML code using a Velocity template. The **Velocity Test Class** import java.io.StringWriter; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; public … |
The End.