Questions tagged [setbackground]
134 questions
0
votes
2 answers
How to use txtV1.setBackground(getResources().getDrawable(R.drawable.bcgrtxt));`in Older Devices?
How to use
txtV1.setBackground(getResources().getDrawable(R.drawable.bcgrtxt));
in Older Devices ?
![](../../users/profiles/1854282.webp)
Hossam Hassan
- 595
- 1
- 7
- 19
0
votes
1 answer
change color of item in listview (without click)
I've tried to change the background color of specific items in a ListView.
first, catch it from database:
ListAdapter adapter = new ArrayAdapter(getApplicationContext(),
android.R.layout.simple_list_item_1, db.getAllApps());
…
![](../../users/profiles/3231338.webp)
kadddah
- 69
- 6
0
votes
2 answers
Animate bg color with hsb model Java
I'm fairly new to java, so i don't think I have this fairly close to right, but I can seem to find any other help with this. Basically, I'm trying to animate a jPanel's background color so that it's hue (I'm using an hsb color model) changes. sort…
![](../../users/profiles/3396887.webp)
electricity
- 3
- 1
0
votes
1 answer
Strange setBackground() error - Java Swing
import java.awt.*;
import javax.swing.*;
public class JFrameGUI extends JFrame
{
JLabel item1;
public JFrameGUI(int l, int b , String Title)
{
setTitle(Title);
setLayout(new FlowLayout());
setSize(l, b);
…
![](../../users/profiles/2458090.webp)
MapleNSteel
- 43
- 6
0
votes
1 answer
Highlight current touched item as selected item
I have a android file explorer application and I need to highlight the selected item. I could select touched items using v.setBackgroundColor() method inside onListItemClick(). But when I touch another file/folder still previous one highlighted. I…
![](../../users/profiles/3103310.webp)
IBunny
- 289
- 7
- 20
0
votes
3 answers
For a Custom JLabel (shape changed) setbackground method paints the rectangle and not the new shape
I have created a custom label by overriding the paintComponent() method as shown below.
But when I call the setBackground() method on this component. It paints the entire rectangle.
I want it to paint only the custom shape.Please help.
Custom Label…
![](../../users/profiles/2102644.webp)
Soniya Chavan
- 73
- 1
- 9
0
votes
1 answer
java.lang.OutOfMemoryError setBackgroundResource
I have different buttons for loading images in imageview.
when the user clicks the first button 10 images are loaded when the user clicks the second button load more images 10, and the other 10 images are not displayed, but when he click the third…
![](../../users/profiles/2352419.webp)
Gioele
- 73
- 1
- 11
0
votes
3 answers
Linear Layout background not showing at all
I set linear layout background as usual by
android:background="@drawable/xxx"
but it not shown at all both on eclipse as well as on device.
My XML file is given below :
![](../../users/profiles/1314893.webp)
huzefa p
- 109
- 7
0
votes
1 answer
Set background color for customview?
I have a custom view and I have to set background color for it every two seconds.I can use canvas.drawARGB() or view.setBackgroundColor().Both change color but I need to increase performance,because that change repeats every two seconds.So I want to…
![](../../users/profiles/1043882.webp)
hasanghaforian
- 13,142
- 8
- 71
- 144
0
votes
1 answer
JApplet setBackground not working
I am wondering why the method setBackground() is not actually making the background black. I have feeling this has something to do with the class implementing JApplet as opposed to Applet but I can not figure out the specifics. It's really bugging…
![](../../users/profiles/2390752.webp)
user2390752
- 1
- 1
0
votes
1 answer
Android using switchpreference to set color background
How can I change the color of the app I'm trying to develop.
I have used a switch statement under preferences menu, but do not know how I can code this, so that when the user clicks on the switch, the background color is changed across the whole…
![](../../users/profiles/954350.webp)
jis
- 75
- 2
- 10
0
votes
1 answer
Background Change gives Force Close
I just made a little code to make my Background change to a Drawable if the Checkbox in my Preferences is checked, and make it go white when it isn't. The code works fine in my MainActivity, but it gives a NullPointerException in another Activity…
![](../../users/profiles/1951299.webp)
TimeWasterNL
- 102
- 5
0
votes
1 answer
add two background image for selected and unselected UISegments iphone
I have two segment buttons (1 and 2) I want to add a background image one for selected segment and another image for unselected segment.How can I do that?
Here is what I have so far,should I set the background image here?:
-…
![](../../users/profiles/2088191.webp)
john MacL
- 49
- 1
- 6
0
votes
0 answers
Android random black screens due to asynctask or something else when switching activities
I created an app which works fine on emulators but sometimes, when switching from an activity to another on a real device (Samsung Note 2), i get a black screen and then after one second, I am forwarded to my previous activity.
Anyone had the same…
![](../../users/profiles/2059811.webp)
Laurent Milleron
- 93
- 1
- 8
0
votes
1 answer
Window setBackGround: causes runtime errors
I added a background color to the window of a well-running simple draw project and build succeeded. Then the fun began: runtime errors appeared in the console window. I found no help in Apple docs and Google. When the same happened in another draw…
![](../../users/profiles/1424907.webp)
j yrez
- 213
- 3
- 11