|
|
But I have seen many people making that using pure java. Sir please if it is not possiblie Please help me for this:-
I am using this code to make an image the background of a jpanel -
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawImage(bgImage, 0, 0, null);
}
Sir how can make the background a gif using this code. Sir please help me. I beg.
|
|
|
|
|
|
Sir you are the only one who replied to my questions. I am very very thankfull for you.
|
|
|
|
|
Hi, I'm a student of Computer Science I have a little task which is I want to read the certificate from USB Token(Entersafe PKI Manager - Epass2003 Auto) and after that, I print it on the Eclipse Console using Java Can Anyone Help me please with this solution.
|
|
|
|
|
I am an absolute beginner in java and l want to practice java code in eclipse code editors. I want to know that do l have to set up the environmental variables first to run programs in eclipse? And also is there will be any harm or changes to my system after setting variables? Please help me..
|
|
|
|
|
|
Recently, l have downloaded jdk in my Windows 10. Now, l didn't rememberd which version of jdk l have installed in my system. I want to know that which version of jdk is installed in my Windows. Please help me.
|
|
|
|
|
java -version
Type that command at the console. And try making use of the documentation.
|
|
|
|
|
Thank you so much for helping me sir but l didn't got your point that what you're trying to say.
|
|
|
|
|
Open a cmd window and type "javac -version". The result will tell you which version of the JDK you have installed.
|
|
|
|
|
|
Might want to also use the following commands. Just as with the other in a command window.
javac -version
where java
where javac
First will show the compiler version. Which should be the same as the java version.
Other two will show you where it is finding those commands so you can verify that it is what you expected.
|
|
|
|
|
Good afternoon! I'm trying to create a custom generic Bean Validator for the email of an author and the name of a category to verify that they are unique and I wish I could use a custom JPQL, the name of the persistence unit in persistence.xml and other variables. However, I don't know how to pass variables inside isValid, I only know how to hardcode them.
public class UniqueFieldValidator<T> implements ConstraintValidator<UniqueField,T> {
@Override
public boolean isValid(T value, ConstraintValidatorContext context)
{
EntityManagerFactory emf = Persistence.createEntityManagerFactory("project");
EntityManager em = emf.createEntityManager();
String jpql = "select a from Author a where a.email = :pEmail";
TypedQuery<Author> query = em.createQuery(jpql, Author.class);
query.setParameter("pEmail", value);
Optional<Author> optAuthor = Optional.of(query.getSingleResult());
if(optAuthor.isPresent())
{
return false;
}
return true;
}
}
modified 3-Jul-21 13:26pm.
|
|
|
|
|
Default Is Valid Implementation As Below public boolean isValid(Object value, ConstraintValidatorContext ctx)
|
|
|
|
|
Hi I am developing a library management system in net-beans. When I run it on my system it works fine however, if try to run it on another system it gives me an error of javax.persistence.Persistence.createEntityManagerFactory("path_to_database_on_my_system"). But this path to database must be changed in this function. How would I do this? Need Help.
|
|
|
|
|
Been messing around for hours and eventually decided to seek the assistance of the internet.
I am trying to make a program where I/the user can add elements into an array (Name, age gender). Once elements have been added to the array, I want to then be able to search a String (name) to find the desired name I am after in the array. The context of the program is adding Climbers to a Climber Database (just an array) of who has climbed what mountain (haven't attempted adding the mountain stuff yet).
In what I've written so far, I keep getting the return null, saying that the searched String cannot be found. I have a feeling that I am failing to pass the parameters of the added element in the array.
For example, I add a 'climber' with the name John, 19, Male in the Climber Class. I then go to the ClubStats class to getClimber and search "John", the only one in the array and I receive a null..
FYI I am using BlueJ here so at a serious basic level.
public class Climber
{
private String name;
private int age;
private String gender;
public Climber(String newName, int newAge, String newGender)
{
name = newName;
age = newAge;
gender = newGender;
}
|
|
|
|
|
I understand that a NPE can come from a variable or method returning null. But what I'm trying to do is get a bank account balance. To do this I first have to correctly enter the account id and nip, which I can do without problems. Then I have 4 options to pick from (right now I only have one implemented properly) so I pick Consulta (consult) and what I should be getting is the account balance but I get a NPE error. Can someone help me figure this out? The classes involve during this process should be SolicitudSaldo (consult balance), ATM, Cuenta (Account), BaseDatosBanco (Bank data base) and Transaccion (Transaction). I think the problem might have to do with how I declare ATM in my Jframe INTERFAZ_TRANSACCIONES.
I'll paste a link to my code since It's quite a lot and I don't want to make this post any longer. My project is in the master branch.
Heres a link to my project in gitHub
GitHub - Emmanck613/ATM_02[^]
|
|
|
|
|
No, we can't - as you say it's "quite a lot" of code - and it needs your data to duplicate the problem.
So, it's going to be up to you.
Fortunately, you have a tool available to you which will help you find out what is going on: the debugger. How you use it depends on your compiler system, but a quick Google for the name of your IDE and "debugger" should give you the info you need.
Put a breakpoint on the first line in the function, and run your code through the debugger. Then look at your code, and at your data and work out what should happen manually. Then single step each line checking that what you expected to happen is exactly what did. When it isn't, that's when you have a problem, and you can back-track (or run it again and look more closely) to find out why.
Sorry, but we can't do that for you - time for you to learn a new (and very, very useful) skill: debugging!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Fortunately I seem to have found the problem, as I suspected, it had to do with how I declared ATM in my jframe.
|
|
|
|
|
<pre>It becomes a name store of 10 names. A random name is chosen from among these 10 names. A line is added with a space between them as much as the number of letters of this name. Try to find this name in 5 guesses. When a correct letter is known, if this letter is more than 1 in the word, they should all be revealed together.</pre>
|
|
|
|
|
This has nothing to do with eclipse, and not a lot with Java. You need to write a specification of the problem showing all the steps needed to get the answer. Once you have that then you can think about writing the Java code to implement it.
|
|
|
|
|
Hey everyone! Last fall, a friend of mine gave me an app idea. It was a multiplayer game that she was handmaking for a while and she wanted me to make a digital version of it.
The rules of the game are similar to Cards Against Humanity - each round, a question is displayed and every player has to answer it with one of the cards in his deck. A delegated player picks the funniest match and the winner gets a point.
I spent a lot of time and effort making this. Any review or feedback would be appreciated!
|
|
|
|
|
We can't review or give feedback - we don't have the app to look at - and if you start posting EXE files no one will download them, if you post a site link we'll assume it's spam, and a store link we know it's spam.
So all we can go on is the description: which is so close to the original that it's probably actionable:
We own the name “Cards Against Humanity,” the graphic design of our game, the slogan, logos, and all of our writing. That means you need a license from us to use any of those things. Please don't make something that's an obvious knockoff of Cards Against Humanity's brand or name. In the United States you have to defend your intellectual property or you lose control of it; please don't force us into a legal conflict where we have to defend ourselves—we just want to write jokes.
I'm not a solicitor, nor do I live in 'murica - but in the UK we have the A moron in a hurry test[^] we this would probably fail.
So ... best I can do: not a review, not really feedback - but I'd think long and hard before I took any further steps with this app if I was you ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|