この背景色を透明にしたいです
java
1 public void paintComponent(Graphics g) { 2 Graphics2D g2 = (Graphics2D) g; 3 // 背景を黒にする 4 g2.setColor(new Color(0,0,0,0)); 5 g2.fillRect(0, 0, 0, 0); 6 // 円を描く 7 moveButton.setContentAreaFilled(false); 8 moveButton.setBorderPainted(false); 9 moveButton.setBounds(x, y, 40, 40); 10 this.add(moveButton); 11 CreateButton crtButton = new CreateButton(); 12 button = crtButton.createButton(8); 13 for(int i=0;i<button.length;i++){ 14 this.add(button[i]); 15 } 16 //もう一度 17 g2.setColor(new Color(0,0,0,0)); 18 g2.fillRect(0, 0, 600, 600); 19 moveButton.setBounds(x, y, 40, 40); 20 21 } 22
g2.setColor(new Color(0,0,0,0));では
背景は透明になりません・・・
そもそも、この灰色の部分を透明にすることは可能ですか?
タイトルバーも消したいです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/22 05:58