Hello Good day. I have an interesting question as it relates to adding a background image to a JPanel (or whichever component is best for what I'm trying to achieve. Hopefully I'll get some help here.)
I have a large picture that I want to use as a background image and I want it to be the background for my JFrame. The only thing is that I don't want the image to resize when the JFrame resizes. I want the image to remain centered in relation to the JFrame's position and size, but I just don't want the view of the image to shrink in size. Any suggestions please?
I'll gladly clarify where needed.
Here's a pictorial illustration.
depends on how you are doing it - do you override paintComponent or is it a JLabel with an ImageIcon?
If it's paintComponent then just draw the image at (panel width - image with)/2, (panel height - image height)/2. Your paintComponent will be called after any resize and will always center the image.
If it's a JLabel then it also depends on the layout manager...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...