What concerns society is conduct, not opinion: if only our actions are just and good, it matters not a straw to others whether our opinions are mistaken.
Sir James Frazer, Psyche's Task 
When Socrates is convicted of rejecting the gods of the city and corrupting the young he makes a compelling argument for justice. He explains why he must stay in prison and accept the death penalty, rather than escape and go into exile in another Greek city. He puts forth his idea that he has acquired an overwhelming obligation to obey the Laws of Athens because they have not only made his entire way of life possible it is to them he owes the fact of his existence. Through these Laws it made it possible for is father to marry his mother thereby making their children legitimate. Once born these same Laws required his father to care for and educate him. The way in which he flourished throughout his life has been due to these Laws.
What was most important to Socrates, though, was the fact that the relationship between the individual and the Law was not coerced. Once the individual had grown up and was able to judge for himself how the city conducted its business he could chose whether to stay or to take his property and leave. By staying this implied an agreement both to abide by the Laws as well as accepting the punishments that they mete out. This is a good description of an implicit contract, implied by his choice to stay in Athens even when he was free to leave it at any point. He determined that the Laws were just when he was flourishing. He felt he couldn’t now contend that the Laws were unjust when he was no longer flourishing.
When someone chooses to live somewhere with complete knowledge of the conditions under which they live and when they have complete freedom to leave, they have entered into the type of implied contract that Socrates felt he had entered into. A just man is, in Socrates' viewpoint, one who recognizes his obligation to the state by obeying its laws. Because the state is morally and politically the most fundamental entity it deserves the deepest respect and highest allegiance. Knowing this just men act accordingly. Socrates goes on to argue in another essay that justice is more than merely obeying laws in exchange that injustice won’t be done as a consequence. The just man has a well regulated soul which makes him a happy man. This leads to a win-win situation in which the individual is receiving a benefit (happiness) and society is receiving a benefit (just men who do not commit injustices). True justice is more than the simple reciprocal obedience to law. Justice begets just men which begets more justice.
Justice is a two pronged process. It is not just doing something merely for the expected recompense but something which requires the effort of well-regulating oneself. It goes beyond doing just things but truly being a just person. When one accepts to live somewhere, to do a specific job, and has the freedom to leave true justice requires not only abiding by the Laws of where one lives or works but in self regulation. One not only acts just, one is just.
This is justice. Obeying the Laws in of the place where you chose to live when you had the choice to leave and regulating yourself to be law-abiding. This combination leads to both happiness and justice. It is with just people we create a just society, we do not force a just society onto the people.