2013年10月31日星期四

About PC client applications using JAVA as butcon

Asked a JAVA program on the PC before the problem is this

put the mouse died so


What is this control ?
or how to achieve it with the code
------ Solution -------------------------- ------------------
no need to repeat postings . . . See so few posts . .


GUI in
You give this button to add a mouse listener position ,
you put the mouse up, triggering the listener , and then change the background image on the line
------ Solution --------------------- -----------------------
package mkdemo; 
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.JPanel; 
public class MouseMonitor extends JPanel {    
protected int _xPos     
protected int _yPos;     
public void tellMouseInfo(int x, int y) {        
_xPos = x;        
_yPos = y;        
repaint();    
}     
@Override     
protected void paintComponent(Graphics g) {        
super.paintComponent(g);
StringBuffer sbuf = new StringBuffer();         
sbuf.append("Mouse Location on screen: x = ");        
sbuf.append(String.valueOf(_xPos));        
sbuf.append(", y = ");         
sbuf.append(String.valueOf(_yPos));         
Rectangle rect = this.getBounds();         
g.drawString(sbuf.toString(), rect.x+20, (rect.y+rect.height)/2);    
}

------ Solution ----------- ---------------------------------
"swing also amazing" look at how to make the interface become beautiful : http://blog.csdn.net/withiter/article/details/7231394
------ Solution ---------------------------------------- ----

  
I just add the JToggleButton JToolBar remove border effects , but also      
  
surrounded button something like this how to remove ? and separated by vertical lines that point it can become  

setBorder (null) If not enough I do not know how to get the
------ For reference only -------------------- -------------------


moderator, I want to know the most is when no mouse put up a series of icons that is how to do ? Why do I use ImageButton appears around the protrusion is like a button that , and I take that example is a series of icons like together , which is what controls to achieve . Give me an example of what has . . JAVA UI for doing this I am a novice , never too done .
------ For reference only -------------------------------------- -

  
moderator, I want to know the most is when no mouse put up a series of icons that is how to do ? Why do I use ImageButton appears around the protrusion is like a button that , and I take that example is a series of icons like together , which is what controls to achieve . Give me an example of what has . . JAVA UI for doing this I am a novice , never too done .  
so will I find examples look
------ For reference only -------------------------- -------------

    
moderator, I want to know the most is when no mouse put up a series of icons that is how to do ? Why do I use ImageButton appears around the protrusion is like a button that , and I take that example is a series of icons like together , which is what controls to achieve . Give me an example of what has . . JAVA UI for doing this I am a novice , never too done .          
so will I look to find examples  

That really thank me for a long time , in fact, did not find such a feeling similar to this effect is very common. . Eclipse functionality with icons on the buttons are like
------ For reference only ------------------------- --------------
a JtoolBar plus button
------ For reference only --------------- ------------------------


I just add the JToggleButton JToolBar remove border effects , but also

surrounded button something like this how to remove ? and separated by vertical lines that point can become what
------ For reference only ------------------------- --------------
been resolved thank you
top

没有评论:

发表评论