Questions tagged [setbackground]
134 questions
72
votes
7 answers
How to solve java.lang.OutOfMemoryError trouble in Android
Altough I have very small size image in drawable folder, I am getting this error from users. And I am not using any bitmap function in code. At least intentionally :)
java.lang.OutOfMemoryError
at…
![](../../users/profiles/1806914.webp)
Utku Soytaş
- 1,385
- 2
- 17
- 30
50
votes
7 answers
set cornerRadius and setbackgroundimage to UIButton
I am trying to set cornerRadius of UIButton but I dont know how to do it.
If I do like this:
button.layer.cornerRadius = 5;
works well, if I do like this :
button.layer.cornerRadius = 5;
[button setBackgroundColor:[UIColor…
user1570600
18
votes
3 answers
Android setBackgroundTintList on pre-lollipop devices
I'm working with FloatingActionButton.
The user should be able to switch the FAB background color within a onClick Event.
However, the recommended call to setBackgroundTintList seems to be only compatible from 21+ API.
How do I - correctly - go…
![](../../users/profiles/3996270.webp)
Matteo
- 1,342
- 2
- 16
- 33
17
votes
3 answers
Android View background changes unexpectedly
I'm building an app that has plenty of screens.
most of the screens have a View at the top with a background color.
I often change that color using view.setBackgroundColor(color)
Here comes the weird thing: sometimes after setting the color of one…
![](../../users/profiles/876603.webp)
dors
- 5,442
- 8
- 40
- 60
11
votes
6 answers
JPanel setBackground(Color.BLACK) does nothing
I have the folowing custom JPanel and I have aded it to my frame using Netbeans GUI builder but the background won't change! I can see the circle, drawing with g.fillOval(). What's wrong?
public class Board extends JPanel{
private Player…
![](../../users/profiles/1181261.webp)
Primož Kralj
- 5,534
- 14
- 65
- 125
9
votes
6 answers
Why does setBackground to JButton does not work?
I have the following simple code:
btn = new JButton();
btn.setBackground(backgroundColor)
I worked when I used:
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
But it stopped to work after I have commented…
![](../../users/profiles/245549.webp)
Roman
- 97,757
- 149
- 317
- 426
7
votes
4 answers
How to set color using integer?
How can i convert color code in integer ex: 13369395 to android specific. Since 13369395 is also an integer i tried doing
mainLayout.setTextColor(13369395);
but its not working.
I also tried converting 13369395 to hexadecimal…
![](../../users/profiles/797423.webp)
Arun
- 1,640
- 1
- 14
- 21
6
votes
7 answers
setBackground(new color()); in java does not understand the given RGB value
I have a program with some gui, on the JFrame I set,
setBackground( new Color(107, 106, 104) );
The issue is that I get a greyish color, but not the right one. If I check it in PhotoShop, it gives me the RGB values (126, 125, 123)
Ps. I have tried…
![](../../users/profiles/944670.webp)
JW_
- 606
- 1
- 8
- 19
6
votes
4 answers
Java JFrame background color not working
I tried using:
frame1.getContentPane().setBackground(Color.yellow);
But it is not working. Can anyone help me?
import java.awt.*;
import java.awt.Color;
public class PlayGame {
public static void main(String[] args) {
GameFrame frame1 = new…
![](../../users/profiles/1170499.webp)
Exorific
- 93
- 2
- 2
- 6
5
votes
2 answers
Setting a background color to my Blackberry application very basic!
This is my screen:
final class GeneralExpenseViewScreen extends MainScreen {
public GeneralExpenseViewScreen() {
super();
LabelField title = new LabelField("TeamMate TEC | Expenses",
LabelField.ELLIPSIS |…
delete
5
votes
3 answers
Issue in setting the background color in pyqtgraph
I've got an issue when using the pyqtgraph module in python.
When I put a white background color to a glscatterplot, the scatter dots just vanish. It is like if the color of background was added to the color of the scatterplot therefore everything…
![](../../users/profiles/4847250.webp)
ymmx
- 3,175
- 4
- 20
- 49
4
votes
3 answers
Android how to get gradient effect on setBackgroundColor
Is there a way to get a gradient effect or a semi-transparant effect when setting the background color of a view? For example, this code:
selView.setBackgroundColor(Color.rgb(240, 128, 128)); // light red
highlights a selected view in a list…
![](../../users/profiles/64895.webp)
Jack BeNimble
- 33,194
- 33
- 113
- 187
4
votes
2 answers
Why won't my background color display in JFrame?
I have two class files:
Screen https://gist.github.com/3020101
JMain https://gist.github.com/3020107
I'm trying to get it to go fullscreen for 5 seconds and display the background (or, at this point, even the foreground) but when I run it it goes…
![](../../users/profiles/1492084.webp)
Ethan Pieper
- 57
- 1
- 2
- 5
4
votes
1 answer
How remove background image from UINavigationBar
I set UINavigationBar background image at root view controller, but i need to remove background image at detail view controller.
With Obj-C I use this code:
if ([[UINavigationBar class] respondsToSelector:@selector(appearance)])
{
…
![](../../users/profiles/1382855.webp)
oMega2B
- 67
- 6
4
votes
3 answers
Change background color editable JComboBox
I am programming an editable combobox in a JFrame Form, but i want to change te background color.
How the program works:
If i click the button "press", then the combobox his background needs to become black.
I…
![](../../users/profiles/1080372.webp)
brouckaertd
- 354
- 2
- 4
- 14