translucency

Java Swing - Translucent Components causing Artifacts

寵の児 提交于 2019-12-04 04:21:02
问题 I'm currently working on a group project for a college course, and I've hit a bit of a stumbling block. The program we have decided to implement is a Peer-to-Peer chat client with a central server for storing and sharing usernames, etc. I've been assigned to do the GUI. A friend jokingly suggested that I include "a flaming background!" So I decided to do just that, but to have a user-chosen background image. As is, only bits and pieces of the background image would be visible with all the

How to make a rectangle in Graphics in a transparent colour?

主宰稳场 提交于 2019-12-03 22:36:31
I'm trying to paint a rectangle on my application in a red shade but I need to make it sort of transparent so that the component under it will still show. However I still want that some colour will still show. The method where I'm drawing is the following: protected void paintComponent(Graphics g) { if (point != null) { int value = this.chooseColour(); // used to return how bright the red is needed if(value !=0){ Color myColour = new Color(255, value,value ); g.setColor(myColour); g.fillRect(point.x, point.y, this.width, this.height); } else{ Color myColour = new Color(value, 0,0 ); g.setColor

How to use a UIVisualEffectView inside of a circle

懵懂的女人 提交于 2019-12-02 23:57:09
I'm making a custom control circle. Part of the circle may be transparent. It would make more visual sense and look better if it was translucent instead of transparent. Because views are rectangular, and I only want the circle to be translucent, not the rest of the rectangle, this is a problem. The UIVisualEffectView is behind the custom control. (Without anything rendered inside of the circle for debugging purposes) As you can see, the view is blurring things outside of the circle. I don't know how to blur inside only the view, and the prerelease documentation is practically empty . My only

Navigation bar becomes transparent when set to translucent

倖福魔咒の 提交于 2019-12-02 00:36:49
I'm using XCode 5.02 and iOS7 SDK. I'm trying to set my navigation bars as translucent but when I do that, they become completely transparent instead. The status bar will also be transparent. I can see the title and buttons on the navigation bar but no background. The same happens in all view controllers in my project, so this is not bound to specific view. When I set translucent = NO, I get solid colors. This is both in the simulator and on a device running iOS7. I have tried setting translucent to ON in the .plist file and also tried setting it directly in code like this in viewDidLoad and

Java Swing - Translucent Components causing Artifacts

旧巷老猫 提交于 2019-12-01 21:11:31
I'm currently working on a group project for a college course, and I've hit a bit of a stumbling block. The program we have decided to implement is a Peer-to-Peer chat client with a central server for storing and sharing usernames, etc. I've been assigned to do the GUI. A friend jokingly suggested that I include "a flaming background!" So I decided to do just that, but to have a user-chosen background image. As is, only bits and pieces of the background image would be visible with all the components over top of it, so I decided to try to implement translucency. This is where my problem lies:

Translucent components inside JPanel

梦想与她 提交于 2019-12-01 09:11:11
I have class MyPanel that extends from JPanel. MyPanel class has JLabel component which holds an icon. My question is how can i paint/render this JLabel component to get translucent effect (see through icon) inside MyPanel class (not create xxxJLabel extends JLabel class and override paintComponents method). Thank you Andrew Thompson One way is to provide a translucent image to the JLabel . That might be done with a standard label, before setIcon() or similar is called, or alternately by extending JLabel and overriding the setIcon() method to do the same. E.G. of 2nd technique Code import java

Translucent components inside JPanel

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 07:20:56
问题 I have class MyPanel that extends from JPanel. MyPanel class has JLabel component which holds an icon. My question is how can i paint/render this JLabel component to get translucent effect (see through icon) inside MyPanel class (not create xxxJLabel extends JLabel class and override paintComponents method). Thank you 回答1: One way is to provide a translucent image to the JLabel . That might be done with a standard label, before setIcon() or similar is called, or alternately by extending

Is it possible to have a translucent windows in java 7 including a title bar?

点点圈 提交于 2019-12-01 04:07:21
Related to this question: Is The Java Tutorials Translucent Window example giving trouble to those playing with jdk7? with jdk1.6.0_26 I seem to be able to apply translucency to a JFrame, but not so with jre7: NativeException: java.awt.IllegalComponentStateException: The frame is decorated ex (jruby scripting java, works jdk1.6 not with jdk7 though): require 'java' class MouseDraw def self.go java_import 'javax.swing.JFrame' java_import 'com.sun.awt.AWTUtilities' f = JFrame.new AWTUtilities.set_window_opacity(f, 0.5) f.set_size 200,200 f.show end end MouseDraw.go So my question is "is it

How to set transparent background of JDialog

我只是一个虾纸丫 提交于 2019-12-01 03:22:59
Hy,.. how can i set the background transparent and "remove" the closeoperation (marked red) ? I only want to show the card :-) Thanks..! yourDialog.setUndecorated(true) should do the trick for the title bar. For having the Frame transparent. You'll have to work on the root panel with yourDialog.getRootPane().setOpaque(false) on it. Although there is no problem with UNDECORATED JFrame transparency (myJFrame.setBackground (new Color (0,0,0,0)); is pretty enough), the same with JDialog is not working. I discovered, however, the following sequence works perfect for JDialog: myJDialog.getRootPane (

Is it possible to have a translucent windows in java 7 including a title bar?

元气小坏坏 提交于 2019-12-01 01:12:16
问题 Related to this question: Is The Java Tutorials Translucent Window example giving trouble to those playing with jdk7? with jdk1.6.0_26 I seem to be able to apply translucency to a JFrame, but not so with jre7: NativeException: java.awt.IllegalComponentStateException: The frame is decorated ex (jruby scripting java, works jdk1.6 not with jdk7 though): require 'java' class MouseDraw def self.go java_import 'javax.swing.JFrame' java_import 'com.sun.awt.AWTUtilities' f = JFrame.new AWTUtilities