35,618 Topics

Member Avatar for
Member Avatar for hemanth suram

Hi All, I need to display a image on page load , but it is not displaying In my jsp page i am calling a method which do some processing (it is taking long to do the process) and after calling the method i am sending the request to another …

0
62
Member Avatar for Bladtman242

I have this annoying problem: I am filling a HashSet out with Road objects, only doing so to avoid duplicate elements. However, the output from lines 81 though 95 shows that the set contains duplicate elements. Sorry for the messy code, this is a pretty ad-hoc sollution, in addition to …

Member Avatar for NormR1
0
3K
Member Avatar for Torf

I'm doing an actually simple practice problem from the book, but I am still not sure how to correctly do it.. It's just converting pseudo code. 1st part > num SIZE = 5 > > num VALID_ITEM_PRICE [SIZE] = 0.59, 0.99, 4.50, 15.99, 17.50, 39.00 > > stack int validItems …

Member Avatar for NormR1
0
155
Member Avatar for soham.m17

How can I keep the lines that have been drawn previously after calling repaint() this is my paintComponent public void paintComponent( Graphics g ) { graphics2D = (Graphics2D)g; graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics2D.setPaint(Color.white); graphics2D.fillRect(0, 0, getSize().width, getSize().height); graphics2D.setColor(Color.black); } I've another method public void show_line(line a) { graphics2D=(Graphics2D)this.getGraphics(); for(int i=1;i<a.getLine_segs().size();i++) { Point …

Member Avatar for soham.m17
0
214
Member Avatar for pendo826

import javax.swing.JFrame; public class MainApp { public static void main(String[] args) { new MainApp().start(); } public void start() { CalculatorUI obj = new CalculatorUI(); obj.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); obj.setSize(275,275); obj.setVisible(true); } } import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JTextField; public class CalculatorUI extends JFrame { //Variables. …

Member Avatar for pendo826
0
163
Member Avatar for utkarshsahu

I am basically trying to make a TicTacToe game in Netbeans GUI builder. I have nine(3x3) buttons to show a grid for the game and that's where you mark X and O's. I want to make it one player game. I wanted to know how to make an array of …

Member Avatar for utkarshsahu
0
126
Member Avatar for rohit_static

I have a jsp page which has post comment box. I have written a servlet which takes a comment from the text area for the comment box and writes the comment to the database and redirects all the comments stored in the database to the page for display(using request dispatcher). …

Member Avatar for Philippe.Lahaie
0
166
Member Avatar for anuj_sharma

Hi, I created an application which allows a user to capture screenshots and save them as images at a pre-defined location. Now, I want to insert the saved images to a word document. I am aware of Apache POI, but that is still under development and it seems that you …

Member Avatar for anuj_sharma
0
1K
Member Avatar for anuj_sharma

am trying to add images to a rtf document. I am able to add images to the document but I can't append any images. This means that when the 2nd Image is added, the first image is removed. I think that whenever the code is executed a new rtf document …

Member Avatar for anuj_sharma
0
1K
Member Avatar for daemonlies

Hey everybody, New to the java scene and having major issues, it would be appreciated if someone could have a look at my coding and see where i'm going wrong. I have a few 1. When i press the 'start new game' button the random number resets but not the …

Member Avatar for NormR1
0
145
Member Avatar for gigglygeckoq

I am new to programming, I am trying to learn how to program in Java through some old programs I found online, and yet I seem to be struggling. This is the program I wrote to fill a linked list with 10 numbers using a loop and then just printing …

Member Avatar for JamesCherrill
0
111
Member Avatar for woodenduck

Hey all, I want to write an application that I can run from the console where it loads settings from a config file. I also want to be able to double click on the executable and obtain a GUI where I can specify settings that will be stored in the …

Member Avatar for NormR1
0
190
Member Avatar for drico7041

Hello, I go to Georgia State University with a Computer Science major. I was wondering what what be a good gpa to graduate with in order to put me ahead of the competition. Mind you Georgia State is my of the top 5 school in Georgia. Thank you

Member Avatar for Rashakil Fol
0
250
Member Avatar for Torf
Member Avatar for JamesCherrill
0
127
Member Avatar for archie.herbias

i want to display some code snippets for my forum. i want to display and html and jsp codes or other codes but i don't know how to fix it because if i display it in a page. it is like that it is included in the page code. i …

0
93
Member Avatar for reaper1395

I'm sure that there is an article on here already about this, but I didn't see it. I'm trying to make my java application executable so I can share it with friends but whenever I use eclipse to make it a jar or executable jar file and send it to …

Member Avatar for reaper1395
0
142
Member Avatar for mikekhd

mport java.awt.Color; import java.awt.Graphics; import javax.swing.JOptionPane; why this is not working need help public class NewClass { static String myBinary; public static void main(String[] args) { String code = JOptionPane.showInputDialog("Please enter zipCode: "); BarCode myBar = new BarCode(code); myBinary = myBar.getCode(); int length= code.length(); if (length != 5 && length!=9) …

Member Avatar for NormR1
0
269
Member Avatar for shean1488

Hi everybody, I'm just wondering what is the more eficient and compact way to write statements like this if(site.next(1) == null) { return false; } if(site.next(2) == null) { return false; } if(site.next(3) == null) { return false; }

Member Avatar for shean1488
0
93
Member Avatar for jjoensuu

Hi, a question about stand-alone Java applications that do not have a background DB. In our Uni class we were asked to build a very small application using JOptionPane methods such as "showInputDialog". The application asks for users name and birthdate and at the end displays a summary of these …

Member Avatar for JamesCherrill
0
442
Member Avatar for hwoarang69

i really hate php and javascrip but i really want to make a social network website just for fun. so i wanted to use java, sql, and html to make. i already know these 3 languages and i know how to set a database but i dont know how to …

Member Avatar for stultuske
0
125
Member Avatar for jayson_g

Im having a difficult time finding info on how to set up a combobox listener for my project. My book has 1 example and it uses audio files.(no help) My project consists of a GUI panel with a splitpane that that has a list of info on the left for …

Member Avatar for jayson_g
0
123
Member Avatar for whileiforelse

Hi all, I'm working on a simple Java project on student database. One of the methods I need to implement obviously involves searching for a student in the student registration using the student id input. Here is what I've been asked to do: *-searchStudentRegistration(String studentId): Using the studentId you will …

Member Avatar for whileiforelse
0
195
Member Avatar for drameshgar1

I got quick question regarding Java less say i got provided with this code: public void printNext(int x){ System.out.println((x+1) % 3); } public void printSequence(){ for (int i=0; i<5; i++) printNext(i); } The question is : 'What sequence of number is printed by printSequence()?' Ok first its going do 0+1=1 …

Member Avatar for JamesCherrill
0
105
Member Avatar for anuj_sharma

Hi, I am trying to create document using iText. I am using Eclipse IDE. I've imported the jar files (itextpdf-5.2.1.jar and itext-xtra-5.2.1.jar). However RtfWriter2 is not being recognised as a class. Document doc = new Document(); RtfWriter2 writer = new RtfWriter2(); RtfWriter2.getInstance(doc,new FileOutputStream("testRTFdocument.rtf")); Can someone help me in figuring out …

Member Avatar for anuj_sharma
0
367
Member Avatar for litchi

Hi :) Is it better to have a one file program (ex. MyProgram.class) or a multiple file one (ex. Main.class and Gui.class and Draw.class)? thx

Member Avatar for Username field
0
142
Member Avatar for lehartcomputing

who can help me?? Create a solution for the following scenario: A local community mobile college unit holds 2 different classes in literacy and numeracy for mature students. A student can join the mobile unit and sign up to one or both classes. The students ID number, forename, surname, age …

Member Avatar for zeroliken
0
201
Member Avatar for bboris

Filterable `AbstractListModel` uses `originalModel` of `JList` as source and excludes those items from `originalModel` that matches exclude criteria specified by given regex. It also allows reusing same model (with filtering capability of course) for multiple JList components. It also registers as `ListDataListener` to `originalModel` model to be able to relay …

0
63
Member Avatar for anuj_sharma

Hi, I've created a small application that allows the user to capture the screenshot and save the image at a user defined location. It also allows the user to capture the screenshot of the active window as well. The issue is with the active window. I have learnt that Java …

Member Avatar for anuj_sharma
0
360
Member Avatar for jimoaks

Hello, I am having some trouble writing this java GUI. First in the win1, i cannot get the start and exit button to the bottom of the page along with the jlabel into the center. Next for win2 i cannot resize the "go here" button at the bottom of the …

0
315
Member Avatar for Torf

I have been trying to teach this myself, but I judt don't get it. I have 10 books with ISBN number, title, name of author. The linked list should display the books sorted by ISBN. I hope this collections.sort is correct: import java.util*; public class Sort { public class Sort …

Member Avatar for Torf
0
227

The End.