32,199 Topics

Member Avatar for
Member Avatar for Napoleon_1
Member Avatar for You Have Been C

import javax.swing.*; import javax.swing.plaf.basic.BasicTreeUI; import java.awt.*; import java.awt.event.FocusListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; public class GamePanel extends JPanel implements Runnable, KeyListener{ final int originTileSize = 16; //The Size of the tiles, or grids final int scale = 3; final int tileSize = originTileSize * scale; final int screenCol = 10; final …

Member Avatar for ivy.inc.Hugh
1
251
Member Avatar for LianaN

Hi! I'm trying to improve a code shown below. My idea is to add multiple images to JPanel. It sounds like an easy task, but all my attempts failed so far. I tried to create [ICODE]Image image2 = getToolkit().getImage(Drag1.class.getResource("cross_cursor.gif"));[/ICODE] and then [ICODE]bi2 = new BufferedImage(image2.getWidth(this), image2.getHeight(this)...);[/ICODE]. But I can see …

Member Avatar for ivy.inc.Hugh
1
2K
Member Avatar for Crona

I have a homework assignment that im not really sure how to approach as of right now, I've done some research but. I have not found really anything that would pertain to what I'm doing. Any help would be appreciated <3 . So far this is what I have: /****************************************************************************** …

Member Avatar for DGPickett
0
268
Member Avatar for Hiruni_3

Create three classes the Calculation class, Conversion class and Menu Class. The Conversion class should have the following methods. double KMToMiles(double distance) double MilesToKM(double distance) double FeetToMetres(double distance) double MetresToFeet(double distance) double KgToPounds(double weight) double PoundsToKg(double weight) double CelciusToFahrenheit(double temperature) double FahrenheightToCelcius(double temperature) The Calculation class should have the following …

Member Avatar for rproffitt
-1
165
Member Avatar for java_marvin

I just dropped in and found something useful. But the java-code had to be extendet. So I would like to share the result. How to contribute code to the diskussion in: https://www.daniweb.com/programming/software-development/threads/332664/adding-multiple-images-to-jpanel-for-dragging-and-dropping-purposes#post2275496 Or is it closed by now.

Member Avatar for Dani
0
69
Member Avatar for moosh101

Hello everyone! I am writing a program for the birthday paradox that runs trials 10,000 times. I want to show that when N people are in a room, there is a 50% chance that there will be a duplicate birthday. I want to create an empty set, then add to …

Member Avatar for toneewa
3
566
Member Avatar for amontellano

Hi everyone, I need ideas on how to initialize a new program in which a class GeometricSequence will extend Sequence. It has to implement public void generate ( ), which generates the sequence via 𝑎𝑖 = 𝑎0∙generator𝑖 (𝑖 = 0, 1, …, numTerms−1) and puts it into a double []. …

0
61
Member Avatar for amontellano

Hello everyone, so I was working on ClippedAudio.java, and the program is supposed to clip the signal. The read method reads in the file audio.txt, the clip method clips the signal, and the write method outputs the clipped signal to the file clipped_audio.txt. I have to add the needed code …

Member Avatar for amontellano
0
23
Member Avatar for amontellano

Hi everyone, I need ideas on how to initialize a new program in which a class GeometricSequence will extends Sequence. It has to implement public void generate ( ), which generates the sequence via 𝑎𝑖 = 𝑎0∙generator𝑖 (𝑖 = 0, 1, …, numTerms−1) and puts it into a double []. …

Member Avatar for amontellano
0
35
Member Avatar for sadbin hoque

package sadbinproject; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; /** * * @author Notebook */ public final class admission_panel extends javax.swing.JFrame { /** * Creates new form admission_panel */ public admission_panel() { initComponents(); Connect(); } Connection con; PreparedStatement pst; public void Connect() { …

Member Avatar for JamesCherrill
0
199
Member Avatar for ervineuer

Im looking for the "best" GUI builder for java. I use Eclipse to write my scripts, and i would appreciate you guys telling me your favourite GUI Builder and the reasons why. Thanks

Member Avatar for jwenting
0
82
Member Avatar for Jinhwan

Create a class named SavingsAccount and provide a method called deposit to allow a customer to deposit to his savings account, another method called withdraw to allow a customer to withdraw from his savings account, ensure that the debit amount does not exceed the savings account balance. If it does, …

-2
109
Member Avatar for nirmal.patel.59

I am working on search API. Currently I am havinng 3 filter i.e. author, publish date, topic. Now I have created a Search API along with paginantion. based on request data it provides result (default page size is 10 for pagination). Now I want to acheive following. Whenver I change …

Member Avatar for Dani
0
120
Member Avatar for federerforehand

I do not know where to even start :'( can someone please write the code so I can see the process and I can do other problems that are similar to this... For this programming project, you will create a program that will both design and implement a class that …

Member Avatar for Jerry_23
-2
4K
Member Avatar for Khoa_2

Hi everyone, i want to solve the problem below with dynamic programming but i dont know where to start. Can anyone suggest me something? So the problem is about the find the minimum path with maximums golds. This is the code i have tried so far but it gets me …

Member Avatar for rproffitt
0
185
Member Avatar for asfghjkl

Hi everyone, I just want to ask if how i am able to make an if else statement inside a switch case. i want to execute something wherein the user may be able to choose again if he/she would like to do another transaction. for example, the user choose Yes …

Member Avatar for kasmar45
0
266
Member Avatar for nextsmm

Is it necessary to have computer or laptop to test the code? Did you ever seen anyone who can be perfect or master in coding whit cell phone?

Member Avatar for DGPickett
3
234
Member Avatar for Dean_14
Member Avatar for jeff79
Member Avatar for Ghostzy

**You are tasked to make a game of WAR! ** War is a card game played between two people. Each person gets half of a shuffled deck of cards. They both place the top card of their deck onto the field and the winner is the one whose card has …

Member Avatar for JamesCherrill
-1
128
Member Avatar for eliasarximan

Can Someone help me to convert my Python Code to Java Code please? My Python Code : def import_file(file): with open(file,"r") as f: lines = f.readlines() sline = [] for line in lines: xline=line.split(" ") sline.append(xline) return sline def set_file(idf,q,sline): for i in sline: if idf in i: sline[sline.index(i)][1] = …

Member Avatar for Srinu@231
0
291
Member Avatar for shak187

hi there i have some python coding which i need to convert to java can ne1 help me please email me back if you can help then i will show you the coding much appriciated

Member Avatar for eliasarximan
2
154K
Member Avatar for AbstractEden

I've been having a tough time trying to figure this one out. Wrote a couple of notes on my phone and ended up with this as a result: import java.io.*; import java.util.Scanner; public class Assignment1 { //Returning if a character is a vowel or not. public static boolean isVowel(char c) …

Member Avatar for alex205
0
3K
Member Avatar for Kurosaki

Hi. I'm new to java programming and I need help with this assignment. [quote]Giving change. Implement a program that directs a cashier how to give change. The program has two inputs: the amount due and the amount received from the customer. Compute the difference, and compute the dollars, quarters, dimes, …

Member Avatar for JamesCherrill
0
7K
Member Avatar for Iskodaraog

Direction: create a program to computer for the final grade using scanner and JOptionpane. Given: Quiz- 20% Activity-60% Exam-20% Output Enter guiz grade: Enter activity grade: Enter exam grade: The final grade of: (Student name) si: (total of quiz, activity,and exam grade

Member Avatar for Kazalwadi
0
66
Member Avatar for dimitrilc

## Introduction ## When localizing your application, `ResourceBundle` can be a great way to load Strings from different locales. The only concrete implementation of ResourceBundle is `PropertyResourceBundle`, which allows us to load static Strings from a text file. Because `.properties` is a common file extension used for ResourceBundles, creating ResourceBundle …

2
220
Member Avatar for dimitrilc

## Introduction ## Junit is a popular framework to create tests for Java applications. Although individual unit tests are mostly straightforward, integration and functional tests are a little bit more involved because they usually require multiple components working together. For that reason, understanding the life cycle of Junit tests can …

2
228
Member Avatar for dimitrilc

## Introduction ## When collecting a stream, the `groupingBy()` Collector(`java.util.stream.Collector`) can be used to put data into different groups based on specified conditions. `groupingBy()` is a little bit more complicated to use than [partitioningBy()](https://www.daniweb.com/posts/jump/2280662) because the key can be of any type, whereas with `partitioningBy()`, the keys must be of …

2
121
Member Avatar for dimitrilc

## Introduction ## Whenever we want to modify numbers from multiple threads running concurrently, such as modifying a counter, one of the best options is to use the AtomicX classes. The most basic numeric atomic classes are AtomicInteger and AtomicLong. In this tutorial, we will learn how to use the …

2
97

The End.