J.Q. Adams' presidency isn't particularly remembered as a success -- he wasn't the last president to face a hostile Congress -- but he was much else besides, including a highly talented diplomat and cabinet member in service of the young United States, and a member of the U.S. House of Representatives from 1831 until his death on February 23, 1848, two days after he had (presumably) had a stroke on the floor of that chamber.
During his tenure in Congress, Adams because a prominent opponent of slavery, though not strictly speaking an abolitionist (more that once he predicted correctly that only a civil war would eventually end the peculiar institution). In 1841, he famously argued before the U.S. Supreme Court in the Amistad case, a cause célèbre of the time.
At issue was the status of enslaved Africans, led by one of the number called Cinque, who had in 1839 taken control of the Spanish ship Amistad, on which they were being transported. The ship ended up in the United States, and, with the help of sympathizers, Cinque and the others fought for their freedom in American courts. The U.S. government, in particular the Van Buren administration, wanted the Africans turned over to the Spanish, presumably to please the Spanish government, but also to mollify U.S. slaveholders.
In 1997, Anthony Hopkins portrayed Congressman Adams in the film Amistad. The following is a dramatized take on Adams' appearance before the court in late February 1841, but true to the spirit of his arguments.
The full text of Adams' argument is here. The Africans won their freedom.