How to access JPanel object throught JFrame

Leave a comment

Now I will setup two objects in java swing frame work.
One object named “PanelUser”, and one more object named “FrameRegister”.

PanelUser:

class PanelUser extends JPanel{

public JPanel getPanelUser(){

return this;

}

public void setPanelUser(JPanel passedPanel){

this = passedPanel

}

}

So now I want to access to PanelUser to get JPanel to user in my FrameRegister.

FrameRegister:

class FrameRegister extends JFrame{

PanelUser panelUser = new PanelUser();

publicĀ  FrameRegister(){

JPanel panel = panelUser.getPanelUser();

this.getContentPane().add(panel);

}

public static void main(String arg){

new FrameRegister().show();

}

}
Advertisements

NginxHttpRewriteModule

Leave a comment

NginxHttpRewriteModule Documentation

# redirects arbitrary subdomain (some.random.sub.example.com) to (some.random.sub.example.org)
if ($host ~* “^([^.]+(\.[^.]+)*)\.example.com$”){
set $subd $1;
rewrite ^(.*)$ http://$subd.example.org$1 permanent;
break;
}

# Simply redirects example.com to example.org
if ($host ~* “^example.com$”){
rewrite ^(.*)$ http://example.org$1 permanent;
break;
}

Ruby Syntax

Leave a comment

Ruby Syntax

Solr Tutorial

Leave a comment

Solr Tutorial

Custom Analyzer in Lucene

Leave a comment

Custom Analyzer in Lucene

Encode URL

Leave a comment

encodeURI, escape, encodeURIComponent, or you can click below link.
URLEncode