35,617 Topics

Member Avatar for
Member Avatar for Argyrisv

Hello i am having a problem in removing all headers from a Part in java mail.The code i use : [CODE] Enumeration headers = part.getAllHeaders(); while (headers.hasMoreElements()) { Header h = (Header) headers.nextElement(); System.out.println(h.getName() + ": " + h.getValue()); part.removeHeader(h.getName()); } [/CODE] The System.out.println gives me right names an values!!But …

0
60
Member Avatar for gedas

hey, can someone explain to me exactly how this code works because i dont really understand the logic of it. [CODE] public void paintComponent(Graphics g) { super.paintComponent(g); Dimension d = getSize(); checkOffScreenImage(); Graphics offG = mImage.getGraphics(); offG.setColor(backgroundColor); offG.fillRect(0, 0, d.width, d.height); Graphics2D g2 = (Graphics2D) mImage.getGraphics(); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // draw …

0
50
Member Avatar for Neversleepin

Hi, i'm trying to use regex to delete lines which starts with a letter or a number. for example: if i have a text file with many lines and i want to delete every lines which starts with S and 2. What operator do i have to use? i tried …

Member Avatar for Neversleepin
0
2K
Member Avatar for CHOCHOCHO

i need to sort by last name [CODE]import java.util.Scanner; import java.util.ArrayList; import java.util.Scanner; public class TestStudent { public static void main(String[] args) { //Course Code String [] courseNumber = {"MTH151","MTH201","ITF215","ENG101","HIS210","BIO120"}; //Course Name String [] courseName = {"Statistics","Calculus I","Programming in Java",-"Composition","US History","Biology "}; //Credit int [] credit = {3,4,4,3,3,4}; ArrayList <Student> …

Member Avatar for jon.kiparsky
0
343
Member Avatar for earwax

Hi i need to press non-english keys like "ü","ö" in java but i didnt managed to do this using robot class. So how can i press non-english characters?

Member Avatar for earwax
0
237
Member Avatar for Xessa

I want to connect to an FTP server and transfer a file with Java. I could not find anything about secure FTP.Can anybody help me about this? I also want to ask that if i can connect to an FTP server using SSL with command line. If i can connect …

Member Avatar for vglass
0
204
Member Avatar for Fluffybunny

Hi, I want to launch a java app from within python, and read back the test the java app writes in a command window. This is using python on windows. So, I have a basic java app which brings up a cmd.exe widow, and prints "hello world", waits for 5 …

Member Avatar for Gribouillis
0
109
Member Avatar for stephy1

I am retrieving values from database. I initialized a variable outside the loop. I am using while loop to move one record after other to last using ResultSet object.next(). Inside the while I am assigning the record value to the variable initialized outside while. But It shows variable might not …

Member Avatar for VernonDozier
0
173
Member Avatar for brynFlew

How do i share variables between java beans, do i need to use jspGet property on the second jsp and re-set it, or can i skip that and do it another way. i need to get a value from my login.jsp and UserDataBean to my process.jsp and my MyFormBean so …

0
67
Member Avatar for jaho

Dear Friends..Hi..! i wanna implement a graph by java..& as i searched i think the best way is using jgrapht & jgraph libraries.. but i dont know exactly how.. can u help me?

0
44
Member Avatar for vishal18

Dear friends, Thanks in advance..... I'm working on project which includes multiple frames. whenever I need to open other frame with first one get closed , I have used new instance of new class(frame) and I just make setVisible(false) for previous frame. Now after some use , there is problem …

Member Avatar for vishal18
0
94
Member Avatar for ComicStix

Hello everyone! So I have to do this project for computer science class. We have to make a class that generates 50 odd numbers in order starting at 1 and stores them in an array of 50 int elements. Then we have to arrange the numbers we get so that …

Member Avatar for adarshcu
0
307
Member Avatar for bartm669

Hi all i need a piece of code that will find a value in an array and change it. [CODE] private int[][] level = new int[][]{ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, …

Member Avatar for bartm669
0
133
Member Avatar for stephy1

I got Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at this line.[CODE]File f1= new File(args[0]);[/CODE] I guess i have to give a command line argument. How to give a file as command line argument. Or is this someother one?

Member Avatar for masijade
0
723
Member Avatar for sj5536

hi i want to upload my application in google web stroe with help of my own desktop application which allows me to login as well as to upload my application on web stor

0
70
Member Avatar for zetologos

Im playing around with the clone method of arraylist and have a few questions. This is what i did with it: [CODE] ObjectMaker item1 = new ObjectMaker(); ObjectMaker item2 = new ObjectMaker(); ObjectMaker item3 = new ObjectMaker(); ArrayList<ObjectMaker> arrayList = new ArrayList<ObjectMaker>(); arrayList.add(item1); arrayList.add(item2); arrayList.add(item3); Object theList = arrayList.clone(); [/CODE] …

Member Avatar for naief
0
185
Member Avatar for Zabzacon

Okay, so I am trying to make a game much like an old game called "Chip's Challenge". Right now I have a square that I can control with the arrow keys but I'm not sure how to make a wall that cannot be passed through, could anyone help me?

Member Avatar for Zabzacon
0
154
Member Avatar for stroper

Hy everyone, I am programming boggle in Java. I have some problems though. method guess() should be repeated for 3 minutes, when the 3 minutes are over method endGame() should be executed. How do I have to do this? I think i need to use the java.util.Timer but I have …

Member Avatar for mangopearapples
0
1K
Member Avatar for CyberCop

hello, i am a begginer in java programming and i have a question, my question is, i want to create a java loader that means how to load components, images ... and to display a screen that indicates the applet is loading components and when components, images are loaded, just …

0
48
Member Avatar for lancevo3

Hey guys I am writing my first program ever in java starting tonight and all has actually gone smooth which has been a surprise but I have run into a problem with an if else area. Basically, what I am suppose to be doing in this section is the user …

Member Avatar for lancevo3
0
142
Member Avatar for dangari

Hi guys. I have a Java program that works in 3 stages after connecting to a MySQL database to give desired results. The first stage involves a function X that returns a value it finds in table A or zero. The second stage involves a function Y that's only allowed …

Member Avatar for dangari
0
133
Member Avatar for ROSS679

Hi Everyone I have been hard at work on this Java program involving bicycle gears, one of the problems is the while loop, should a user enter a negative number in the inputs then i want the user to re enter it until a positive number comes up however the …

Member Avatar for ROSS679
0
193
Member Avatar for chipsch

So this is what i am trying to do. Create just a 5 element array and using the scanner utility get some information from the user that can then be passed down to an object that is dynamically created by the array. The object requires paramaters due to constructors. [CODE]Employee[] …

Member Avatar for chipsch
0
176
Member Avatar for stroper

hy everyone, I have a problem, I am making a little program for a game; When I start my game the timer has to start counting and after 3 minutes the game has to stop. I need to know a way to program a very simple counter/timer in order to …

Member Avatar for mangopearapples
0
307
Member Avatar for rohit2

I am using a Jtextpane in my application. I want to switch to line number I want . How can I implement Goto line feature in java for jTextpane. please help....

Member Avatar for naief
0
89
Member Avatar for maipelo

what are the reasons for creating a website using java technology and how does this technology ensures security of the website

Member Avatar for mangopearapples
0
75
Member Avatar for stroper

Hye everyone, I am trying to make a 2d-char array, fill it with random letters(chars) and print it. If I do it like this I get a ArrayIndexOutOfBoundsException: 0. I am a newbee. I import my prefs(width, height) from static getters in the class preferences. Can anyone help me please? …

Member Avatar for stroper
0
469
Member Avatar for xshinichix

Our teacher gave us an assignment.Can anyone help or give me some idea on how to solve this java problem? im still learning java. Here's the problem: "Write some code to demonstrate to yourself the chain of construction. Create an inheritance hierarchy of 4 classes. Give them any names you …

Member Avatar for jon.kiparsky
0
188
Member Avatar for palamonin

Design program Infix that will convert the expression from infix notation to post fix notation using Stack operation. Observe hierarchy of operators. Sample Input/output Enter infix : 4+6*7-8 Postfix equivalent is 467*+8-

Member Avatar for jon.kiparsky
0
51
Member Avatar for rohit2

I am using a Jtextpane in my application. I want to add line number in it. How can I do it. please help....

0
68

The End.